Compare commits

...

6 commits

10 changed files with 69 additions and 67 deletions

View file

@ -5,7 +5,7 @@ class UserProvider with ChangeNotifier {
User _user = User.noUser;
int _selectedTabIndex = 0;
List<String> _categories = ["All", "Workplace", "Equipment", "Home", "Other"];
List<String> _categories = ["Workplace", "Equipment", "Home", "Other"];
List<String> get categories => _categories;

View file

@ -57,19 +57,24 @@ class _HistoryScreenState extends State<HistoryScreen> {
children: [
DropdownButton<String>(
isExpanded: true,
items: Provider.of<UserProvider>(context, listen: true)
.categories
.map((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value),
);
}).toList(),
items: [
DropdownMenuItem<String>(
value: null,
child: Text('All'),
),
...Provider.of<UserProvider>(context, listen: true)
.categories
.map((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value),
);
})
],
hint: new Text("Select Category"),
value: Provider.of<TransactionProvider>(context,
listen: true)
.selectedCategory ??
'All',
.selectedCategory,
onChanged: (String? newValue) {
Provider.of<TransactionProvider>(context,
listen: false)

View file

@ -247,7 +247,7 @@ class _HomeScreenState extends State<HomeScreen> {
SizedBox(
height: 20.0,
),
ExpensesChart()
Container(height: 200, width: 200, child: ExpensesChart())
],
)
],

View file

@ -12,6 +12,14 @@ class ExpensesChart extends StatefulWidget {
class ExpensesChartState extends State {
int? touchedIndex;
bool disposed = false;
@override
void dispose() {
disposed = true;
super.dispose();
}
@override
Widget build(BuildContext context) {
List<String> categories =
@ -24,6 +32,7 @@ class ExpensesChartState extends State {
pieTouchData:
PieTouchData(touchCallback: (event, pieTouchResponse) {
if (pieTouchResponse == null) return;
if (disposed) return;
setState(() {
if (event is FlLongPressEnd || event is FlPanEndEvent) {

View file

@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:pin_code_fields/pin_code_fields.dart';
import 'package:robo_advisory/utils/constants.dart';
import 'package:robo_advisory/config/Routes.dart';
import 'package:robo_advisory/widgets/buttons.dart';
class LoginScreen extends StatelessWidget {
bool rememberSwitch = false;
@ -21,9 +22,7 @@ class LoginScreen extends StatelessWidget {
Expanded(
child: Container(
child: Center(
child: FlatButton(
splashColor: Colors.transparent,
highlightColor: Colors.transparent,
child: ElevatedButton(
onPressed: () {
Navigator.pushNamed(context, Routes.register);
},
@ -110,9 +109,7 @@ class LoginScreen extends StatelessWidget {
// activeTrackColor: Colors.white,
// activeColor: Colors.white,
),
FlatButton(
splashColor: Colors.transparent,
highlightColor: Colors.transparent,
TextButton(
onPressed: () {
Navigator.pushNamed(
context, Routes.splashScreen);
@ -126,17 +123,12 @@ class LoginScreen extends StatelessWidget {
),
SizedBox(
width: double.infinity,
child: RaisedButton(
color: Color(0xFF495057),
textColor: Colors.white,
child: ElevatedButton(
style: mainButtonStyle(),
onPressed: () {
Navigator.pushNamed(context, Routes.dashboard);
},
child: Text('Log In'),
padding: EdgeInsets.all(18.0),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(18.0),
),
),
)
],

View file

@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:pin_code_fields/pin_code_fields.dart';
import 'package:robo_advisory/utils/constants.dart';
import 'package:robo_advisory/screens/register/register_step_2.dart';
import 'package:robo_advisory/widgets/buttons.dart';
class RegisterFirstScreen extends StatelessWidget {
@override
@ -89,9 +90,8 @@ class RegisterFirstScreen extends StatelessWidget {
),
SizedBox(
width: double.infinity,
child: RaisedButton(
color: Color(0xFF495057),
textColor: Colors.white,
child: ElevatedButton(
style: mainButtonStyle(),
onPressed: () {
Navigator.push(
context,
@ -103,10 +103,6 @@ class RegisterFirstScreen extends StatelessWidget {
);
},
child: Text('Continue'),
padding: EdgeInsets.all(18.0),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(18.0),
),
),
)
],

View file

@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:robo_advisory/utils/constants.dart';
import 'package:robo_advisory/config/Routes.dart';
import 'package:robo_advisory/widgets/buttons.dart';
class RegisterSecondScreen extends StatelessWidget {
@override
@ -56,18 +57,13 @@ class RegisterSecondScreen extends StatelessWidget {
),
SizedBox(
width: double.infinity,
child: RaisedButton(
color: Color(0xFF495057),
textColor: Colors.white,
child: ElevatedButton(
style: mainButtonStyle(),
onPressed: () {
Navigator.pushNamed(context, Routes.dashboard);
print('Next Step');
},
child: Text('Register'),
padding: EdgeInsets.all(18.0),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(18.0),
),
),
)
],

11
lib/widgets/buttons.dart Normal file
View 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),
));
}

View file

@ -7,7 +7,7 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.8.2"
version: "2.9.0"
boolean_selector:
dependency: transitive
description:
@ -21,28 +21,21 @@ packages:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.1"
version: "1.2.1"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.1.1"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.15.0"
version: "1.16.0"
crypto:
dependency: transitive
description:
@ -70,7 +63,7 @@ packages:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
version: "1.3.1"
ffi:
dependency: transitive
description:
@ -117,7 +110,7 @@ packages:
name: flutter_svg
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
version: "1.1.5"
flutter_test:
dependency: "direct dev"
description: flutter
@ -155,28 +148,28 @@ packages:
name: js
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.3"
version: "0.6.4"
matcher:
dependency: transitive
description:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.11"
version: "0.12.12"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
version: "0.1.5"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.0"
version: "1.8.0"
nested:
dependency: transitive
description:
@ -190,7 +183,7 @@ packages:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
version: "1.8.2"
path_drawing:
dependency: transitive
description:
@ -260,7 +253,7 @@ packages:
name: petitparser
url: "https://pub.dartlang.org"
source: hosted
version: "4.4.0"
version: "5.0.0"
pin_code_fields:
dependency: "direct main"
description:
@ -363,7 +356,7 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.1"
version: "1.9.0"
stack_trace:
dependency: transitive
description:
@ -384,21 +377,21 @@ packages:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.1.1"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
version: "1.2.1"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.8"
version: "0.4.12"
typed_data:
dependency: transitive
description:
@ -412,7 +405,7 @@ packages:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
version: "2.1.2"
win32:
dependency: transitive
description:
@ -433,7 +426,7 @@ packages:
name: xml
url: "https://pub.dartlang.org"
source: hosted
version: "5.3.1"
version: "6.1.0"
sdks:
dart: ">=2.16.2 <3.0.0"
flutter: ">=2.10.0"
dart: ">=2.17.0 <3.0.0"
flutter: ">=2.11.0-0.1.pre"

View file

@ -33,7 +33,7 @@ dependencies:
shared_preferences: ^2.0.15
flutter_spinkit: ^5.1.0
pin_code_fields: ^7.4.0
flutter_svg: ^1.0.3
flutter_svg: ^1.1.5
google_fonts: ^3.0.1
fl_chart: ^0.55.1
flutter_custom_dialog: ^1.3.0