Compare commits
6 commits
0e106e65a5
...
0637bd0d4d
Author | SHA1 | Date | |
---|---|---|---|
Motia Benachour | 0637bd0d4d | ||
Motia Benachour | 3baa33a838 | ||
Motia Benachour | a6a5660fc4 | ||
Motia Benachour | 4fab441eed | ||
Motia Benachour | 35a2d8ccdb | ||
Motia Benachour | 355b3cb4ef |
|
@ -5,7 +5,7 @@ class UserProvider with ChangeNotifier {
|
||||||
User _user = User.noUser;
|
User _user = User.noUser;
|
||||||
int _selectedTabIndex = 0;
|
int _selectedTabIndex = 0;
|
||||||
|
|
||||||
List<String> _categories = ["All", "Workplace", "Equipment", "Home", "Other"];
|
List<String> _categories = ["Workplace", "Equipment", "Home", "Other"];
|
||||||
|
|
||||||
List<String> get categories => _categories;
|
List<String> get categories => _categories;
|
||||||
|
|
||||||
|
|
|
@ -57,19 +57,24 @@ class _HistoryScreenState extends State<HistoryScreen> {
|
||||||
children: [
|
children: [
|
||||||
DropdownButton<String>(
|
DropdownButton<String>(
|
||||||
isExpanded: true,
|
isExpanded: true,
|
||||||
items: Provider.of<UserProvider>(context, listen: true)
|
items: [
|
||||||
.categories
|
DropdownMenuItem<String>(
|
||||||
.map((String value) {
|
value: null,
|
||||||
return DropdownMenuItem<String>(
|
child: Text('All'),
|
||||||
value: value,
|
),
|
||||||
child: Text(value),
|
...Provider.of<UserProvider>(context, listen: true)
|
||||||
);
|
.categories
|
||||||
}).toList(),
|
.map((String value) {
|
||||||
|
return DropdownMenuItem<String>(
|
||||||
|
value: value,
|
||||||
|
child: Text(value),
|
||||||
|
);
|
||||||
|
})
|
||||||
|
],
|
||||||
hint: new Text("Select Category"),
|
hint: new Text("Select Category"),
|
||||||
value: Provider.of<TransactionProvider>(context,
|
value: Provider.of<TransactionProvider>(context,
|
||||||
listen: true)
|
listen: true)
|
||||||
.selectedCategory ??
|
.selectedCategory,
|
||||||
'All',
|
|
||||||
onChanged: (String? newValue) {
|
onChanged: (String? newValue) {
|
||||||
Provider.of<TransactionProvider>(context,
|
Provider.of<TransactionProvider>(context,
|
||||||
listen: false)
|
listen: false)
|
||||||
|
|
|
@ -247,7 +247,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 20.0,
|
height: 20.0,
|
||||||
),
|
),
|
||||||
ExpensesChart()
|
Container(height: 200, width: 200, child: ExpensesChart())
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
|
|
@ -12,6 +12,14 @@ class ExpensesChart extends StatefulWidget {
|
||||||
class ExpensesChartState extends State {
|
class ExpensesChartState extends State {
|
||||||
int? touchedIndex;
|
int? touchedIndex;
|
||||||
|
|
||||||
|
bool disposed = false;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
disposed = true;
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
List<String> categories =
|
List<String> categories =
|
||||||
|
@ -24,6 +32,7 @@ class ExpensesChartState extends State {
|
||||||
pieTouchData:
|
pieTouchData:
|
||||||
PieTouchData(touchCallback: (event, pieTouchResponse) {
|
PieTouchData(touchCallback: (event, pieTouchResponse) {
|
||||||
if (pieTouchResponse == null) return;
|
if (pieTouchResponse == null) return;
|
||||||
|
if (disposed) return;
|
||||||
|
|
||||||
setState(() {
|
setState(() {
|
||||||
if (event is FlLongPressEnd || event is FlPanEndEvent) {
|
if (event is FlLongPressEnd || event is FlPanEndEvent) {
|
||||||
|
|
|
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:pin_code_fields/pin_code_fields.dart';
|
import 'package:pin_code_fields/pin_code_fields.dart';
|
||||||
import 'package:robo_advisory/utils/constants.dart';
|
import 'package:robo_advisory/utils/constants.dart';
|
||||||
import 'package:robo_advisory/config/Routes.dart';
|
import 'package:robo_advisory/config/Routes.dart';
|
||||||
|
import 'package:robo_advisory/widgets/buttons.dart';
|
||||||
|
|
||||||
class LoginScreen extends StatelessWidget {
|
class LoginScreen extends StatelessWidget {
|
||||||
bool rememberSwitch = false;
|
bool rememberSwitch = false;
|
||||||
|
@ -21,9 +22,7 @@ class LoginScreen extends StatelessWidget {
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Container(
|
child: Container(
|
||||||
child: Center(
|
child: Center(
|
||||||
child: FlatButton(
|
child: ElevatedButton(
|
||||||
splashColor: Colors.transparent,
|
|
||||||
highlightColor: Colors.transparent,
|
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.pushNamed(context, Routes.register);
|
Navigator.pushNamed(context, Routes.register);
|
||||||
},
|
},
|
||||||
|
@ -110,9 +109,7 @@ class LoginScreen extends StatelessWidget {
|
||||||
// activeTrackColor: Colors.white,
|
// activeTrackColor: Colors.white,
|
||||||
// activeColor: Colors.white,
|
// activeColor: Colors.white,
|
||||||
),
|
),
|
||||||
FlatButton(
|
TextButton(
|
||||||
splashColor: Colors.transparent,
|
|
||||||
highlightColor: Colors.transparent,
|
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.pushNamed(
|
Navigator.pushNamed(
|
||||||
context, Routes.splashScreen);
|
context, Routes.splashScreen);
|
||||||
|
@ -126,17 +123,12 @@ class LoginScreen extends StatelessWidget {
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: RaisedButton(
|
child: ElevatedButton(
|
||||||
color: Color(0xFF495057),
|
style: mainButtonStyle(),
|
||||||
textColor: Colors.white,
|
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.pushNamed(context, Routes.dashboard);
|
Navigator.pushNamed(context, Routes.dashboard);
|
||||||
},
|
},
|
||||||
child: Text('Log In'),
|
child: Text('Log In'),
|
||||||
padding: EdgeInsets.all(18.0),
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(18.0),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
|
|
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:pin_code_fields/pin_code_fields.dart';
|
import 'package:pin_code_fields/pin_code_fields.dart';
|
||||||
import 'package:robo_advisory/utils/constants.dart';
|
import 'package:robo_advisory/utils/constants.dart';
|
||||||
import 'package:robo_advisory/screens/register/register_step_2.dart';
|
import 'package:robo_advisory/screens/register/register_step_2.dart';
|
||||||
|
import 'package:robo_advisory/widgets/buttons.dart';
|
||||||
|
|
||||||
class RegisterFirstScreen extends StatelessWidget {
|
class RegisterFirstScreen extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
|
@ -89,9 +90,8 @@ class RegisterFirstScreen extends StatelessWidget {
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: RaisedButton(
|
child: ElevatedButton(
|
||||||
color: Color(0xFF495057),
|
style: mainButtonStyle(),
|
||||||
textColor: Colors.white,
|
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
|
@ -103,10 +103,6 @@ class RegisterFirstScreen extends StatelessWidget {
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: Text('Continue'),
|
child: Text('Continue'),
|
||||||
padding: EdgeInsets.all(18.0),
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(18.0),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:robo_advisory/utils/constants.dart';
|
import 'package:robo_advisory/utils/constants.dart';
|
||||||
import 'package:robo_advisory/config/Routes.dart';
|
import 'package:robo_advisory/config/Routes.dart';
|
||||||
|
import 'package:robo_advisory/widgets/buttons.dart';
|
||||||
|
|
||||||
class RegisterSecondScreen extends StatelessWidget {
|
class RegisterSecondScreen extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
|
@ -56,18 +57,13 @@ class RegisterSecondScreen extends StatelessWidget {
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: RaisedButton(
|
child: ElevatedButton(
|
||||||
color: Color(0xFF495057),
|
style: mainButtonStyle(),
|
||||||
textColor: Colors.white,
|
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.pushNamed(context, Routes.dashboard);
|
Navigator.pushNamed(context, Routes.dashboard);
|
||||||
print('Next Step');
|
print('Next Step');
|
||||||
},
|
},
|
||||||
child: Text('Register'),
|
child: Text('Register'),
|
||||||
padding: EdgeInsets.all(18.0),
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(18.0),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
|
11
lib/widgets/buttons.dart
Normal file
11
lib/widgets/buttons.dart
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
mainButtonStyle() {
|
||||||
|
return ElevatedButton.styleFrom(
|
||||||
|
backgroundColor: Color(0xFF495057),
|
||||||
|
foregroundColor: Colors.white,
|
||||||
|
padding: EdgeInsets.all(18.0),
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(18.0),
|
||||||
|
));
|
||||||
|
}
|
47
pubspec.lock
47
pubspec.lock
|
@ -7,7 +7,7 @@ packages:
|
||||||
name: async
|
name: async
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.8.2"
|
version: "2.9.0"
|
||||||
boolean_selector:
|
boolean_selector:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -21,28 +21,21 @@ packages:
|
||||||
name: characters
|
name: characters
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.0"
|
version: "1.2.1"
|
||||||
charcode:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: charcode
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "1.3.1"
|
|
||||||
clock:
|
clock:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: clock
|
name: clock
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0"
|
version: "1.1.1"
|
||||||
collection:
|
collection:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: collection
|
name: collection
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.15.0"
|
version: "1.16.0"
|
||||||
crypto:
|
crypto:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -70,7 +63,7 @@ packages:
|
||||||
name: fake_async
|
name: fake_async
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.0"
|
version: "1.3.1"
|
||||||
ffi:
|
ffi:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -117,7 +110,7 @@ packages:
|
||||||
name: flutter_svg
|
name: flutter_svg
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.3"
|
version: "1.1.5"
|
||||||
flutter_test:
|
flutter_test:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description: flutter
|
description: flutter
|
||||||
|
@ -155,28 +148,28 @@ packages:
|
||||||
name: js
|
name: js
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.6.3"
|
version: "0.6.4"
|
||||||
matcher:
|
matcher:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: matcher
|
name: matcher
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.12.11"
|
version: "0.12.12"
|
||||||
material_color_utilities:
|
material_color_utilities:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: material_color_utilities
|
name: material_color_utilities
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.1.3"
|
version: "0.1.5"
|
||||||
meta:
|
meta:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: meta
|
name: meta
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.7.0"
|
version: "1.8.0"
|
||||||
nested:
|
nested:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -190,7 +183,7 @@ packages:
|
||||||
name: path
|
name: path
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.8.0"
|
version: "1.8.2"
|
||||||
path_drawing:
|
path_drawing:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -260,7 +253,7 @@ packages:
|
||||||
name: petitparser
|
name: petitparser
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.4.0"
|
version: "5.0.0"
|
||||||
pin_code_fields:
|
pin_code_fields:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -363,7 +356,7 @@ packages:
|
||||||
name: source_span
|
name: source_span
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.8.1"
|
version: "1.9.0"
|
||||||
stack_trace:
|
stack_trace:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -384,21 +377,21 @@ packages:
|
||||||
name: string_scanner
|
name: string_scanner
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0"
|
version: "1.1.1"
|
||||||
term_glyph:
|
term_glyph:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: term_glyph
|
name: term_glyph
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.0"
|
version: "1.2.1"
|
||||||
test_api:
|
test_api:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: test_api
|
name: test_api
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.4.8"
|
version: "0.4.12"
|
||||||
typed_data:
|
typed_data:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -412,7 +405,7 @@ packages:
|
||||||
name: vector_math
|
name: vector_math
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.1"
|
version: "2.1.2"
|
||||||
win32:
|
win32:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -433,7 +426,7 @@ packages:
|
||||||
name: xml
|
name: xml
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.3.1"
|
version: "6.1.0"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=2.16.2 <3.0.0"
|
dart: ">=2.17.0 <3.0.0"
|
||||||
flutter: ">=2.10.0"
|
flutter: ">=2.11.0-0.1.pre"
|
||||||
|
|
|
@ -33,7 +33,7 @@ dependencies:
|
||||||
shared_preferences: ^2.0.15
|
shared_preferences: ^2.0.15
|
||||||
flutter_spinkit: ^5.1.0
|
flutter_spinkit: ^5.1.0
|
||||||
pin_code_fields: ^7.4.0
|
pin_code_fields: ^7.4.0
|
||||||
flutter_svg: ^1.0.3
|
flutter_svg: ^1.1.5
|
||||||
google_fonts: ^3.0.1
|
google_fonts: ^3.0.1
|
||||||
fl_chart: ^0.55.1
|
fl_chart: ^0.55.1
|
||||||
flutter_custom_dialog: ^1.3.0
|
flutter_custom_dialog: ^1.3.0
|
||||||
|
|
Loading…
Reference in a new issue