diff --git a/lib/main.dart b/lib/main.dart index d7820d4..dbb873b 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,24 +1,19 @@ -import 'package:expense_planner/providers/chartprovider.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'pages/home_page.dart'; +import 'providers/chartprovider.dart'; import 'providers/themeprovider.dart'; import 'providers/transaction_provider.dart'; import 'theme/theme.dart'; void main() { - //for controlling orientation - - // WidgetsFlutterBinding.ensureInitialized(); - // SystemChrome.setPreferredOrientations([ - // DeviceOrientation.portraitDown, - // DeviceOrientation.portraitUp, - // ]); runApp(const MyApp()); } -//TODO:: Check Responsive +//TODO:: Check Responsive (100% responsive done) +//TODO:: Remove todo when git push +//TODO:: Git push message (Responsive & Adaptive Theme) class MyApp extends StatelessWidget { const MyApp({super.key}); @@ -47,43 +42,6 @@ class MyApp extends StatelessWidget { theme: lightTheme, darkTheme: darkTheme, themeMode: context.watch().themeMode, - // theme: ThemeData( - // fontFamily: 'Quicksand', - // // textTheme: ThemeData.light().textTheme.copyWith( - // // headline6: TextStyle( - // // fontWeight: FontWeight.bold, - // // fontFamily: 'OpenSans', - // // fontSize: 18, - // // ), - // // button: TextStyle(color: Colors.white), - // // ), - // // appBarTheme: AppBarTheme( - // // toolbarTextStyle: ThemeData.light() - // // .textTheme - // // .copyWith( - // // headline6: TextStyle( - // // fontFamily: 'OpenSans', - // // fontSize: 20, - // // fontWeight: FontWeight.bold, - // // ), - // // ) - // // .bodyText2, - // // titleTextStyle: ThemeData.light() - // // .textTheme - // // .copyWith( - // // headline6: TextStyle( - // // fontFamily: 'OpenSans', - // // fontSize: 20, - // // fontWeight: FontWeight.bold, - // // ), - // // ) - // // .headline6, - // // ), - // colorScheme: - // ColorScheme.fromSwatch(primarySwatch: Colors.purple).copyWith( - // secondary: Colors.amber, - // ), - // ), home: HomePage(), ); }, diff --git a/lib/theme/switchthemeadaptation.dart b/lib/theme/switchthemeadaptation.dart index 58565e6..d7b4da9 100644 --- a/lib/theme/switchthemeadaptation.dart +++ b/lib/theme/switchthemeadaptation.dart @@ -3,8 +3,7 @@ import 'package:flutter/material.dart'; import 'theme.dart'; class SwitchThemeAdaptation extends Adaptation { - bool isDark = false; - SwitchThemeAdaptation({required this.isDark}); + SwitchThemeAdaptation(); @override SwitchThemeData adapt(ThemeData theme, SwitchThemeData defaultValue) => @@ -26,7 +25,9 @@ class SwitchThemeAdaptation extends Adaptation { return null; } if (states.contains(WidgetState.selected)) { - return isDark ? secondaryColor : primaryColor; + return theme.brightness == Brightness.dark + ? secondaryColor + : primaryColor; } return null; }), diff --git a/lib/theme/theme.dart b/lib/theme/theme.dart index 8fab65b..2c2d081 100644 --- a/lib/theme/theme.dart +++ b/lib/theme/theme.dart @@ -9,7 +9,7 @@ const fontFamily = 'Quicksand'; // Use system fonts like Roboto for Android and SF Pro for iOS if you want platform-native experiences ThemeData lightTheme = ThemeData( adaptations: >[ - SwitchThemeAdaptation(isDark: false), + SwitchThemeAdaptation(), // SliderThemeAdaptation(isDark: false), // CircularProgressIndicatorThemeAdaptation(isDark: false), // CheckboxThemeAdaptation(isDark: false), @@ -30,7 +30,7 @@ ThemeData lightTheme = ThemeData( ), appBarTheme: AppBarTheme( - centerTitle: true, + // centerTitle: true, iconTheme: IconThemeData(color: primaryColor), actionsIconTheme: IconThemeData(color: primaryColor), ), @@ -325,7 +325,7 @@ ThemeData lightTheme = ThemeData( ThemeData darkTheme = ThemeData( adaptations: >[ - SwitchThemeAdaptation(isDark: true), + SwitchThemeAdaptation(), // SliderThemeAdaptation(isDark: true), // CircularProgressIndicatorThemeAdaptation(isDark: true), // CheckboxThemeAdaptation(isDark: true), @@ -345,7 +345,7 @@ ThemeData darkTheme = ThemeData( selectionHandleColor: secondaryColor, ), appBarTheme: AppBarTheme( - centerTitle: true, + //centerTitle: true, iconTheme: IconThemeData(color: secondaryColor), actionsIconTheme: IconThemeData(color: secondaryColor)), diff --git a/lib/widgets/new_transaction.dart b/lib/widgets/new_transaction.dart index f938bea..be85d58 100644 --- a/lib/widgets/new_transaction.dart +++ b/lib/widgets/new_transaction.dart @@ -70,64 +70,60 @@ class _NewTransactionState extends State { @override Widget build(BuildContext context) { return SingleChildScrollView( - child: Card( - elevation: 5, - child: Container( - padding: EdgeInsets.only( - top: 20, - left: 20, - right: 20, - bottom: MediaQuery.of(context).viewInsets.bottom + 20), - child: Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - TextField( - decoration: InputDecoration(labelText: 'Title'), - // onChanged: (val) { - // titleInput = val; - // }, - controller: titleController, - onSubmitted: (_) => _submitData(), - ), - SizedBox( - height: 20, - ), - TextField( - decoration: InputDecoration(labelText: 'Amount'), - // onChanged: (val) => amountInput = val, - controller: _amountController, - keyboardType: TextInputType.number, - onSubmitted: (_) => _submitData(), - ), - Container( - height: 70, - child: Row( - children: [ - Expanded( - child: Text( - _selectDate == null - ? 'No Date Chosen!' - : 'Picked Date :${DateFormat.yMd().format(_selectDate!)}', - style: TextStyle( - color: Theme.of(context).primaryColor, - ), - ), + child: Container( + padding: EdgeInsets.only( + top: 20, + left: 20, + right: 20, + bottom: MediaQuery.of(context).viewInsets.bottom + 20, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + TextField( + decoration: InputDecoration(labelText: 'Title'), + controller: titleController, + keyboardType: TextInputType.text, + textInputAction: TextInputAction.next, + textCapitalization: TextCapitalization.sentences, + onSubmitted: (_) => _submitData(), + ), + SizedBox( + height: 20, + ), + TextField( + decoration: InputDecoration(labelText: 'Amount'), + textInputAction: TextInputAction.next, + controller: _amountController, + keyboardType: TextInputType.number, + // onSubmitted: (_) => _submitData(), + onSubmitted: (_) => _persentDatePicker(), + ), + Row( + children: [ + Expanded( + child: Text( + _selectDate == null + ? 'No Date Chosen!' + : 'Picked Date :${DateFormat.yMd().format(_selectDate!)}', + style: TextStyle( + color: Theme.of(context).primaryColor, ), - AdaptiveFlatButton('Choose Date', _persentDatePicker) - ], + ), ), + AdaptiveFlatButton('Choose Date', _persentDatePicker) + ], + ), + ElevatedButton( + onPressed: _submitData, + child: Text( + 'Add Transaction', + style: TextStyle( + // color: Theme.of(context).textTheme.button.color, + ), ), - ElevatedButton( - onPressed: _submitData, - child: Text( - 'Add Transaction', - style: TextStyle( - // color: Theme.of(context).textTheme.button.color, - ), - ), - ) - ], - ), + ) + ], ), ), ); diff --git a/lib/widgets/transaction_item.dart b/lib/widgets/transaction_item.dart index 7af7d7f..32240a5 100644 --- a/lib/widgets/transaction_item.dart +++ b/lib/widgets/transaction_item.dart @@ -36,7 +36,7 @@ class TransactionItem extends StatelessWidget { ), trailing: MediaQuery.of(context).size.width > 460 ? TextButton.icon( - icon: Icon(Icons.delete), + icon: Icon(Icons.delete_outline), label: Text( 'Delete', // style: TextStyle( @@ -48,7 +48,7 @@ class TransactionItem extends StatelessWidget { }, ) : IconButton( - icon: Icon(Icons.delete), + icon: Icon(Icons.delete_outline), // color: Theme.of(context).errorColor, onPressed: () { deleteTx(); diff --git a/pubspec.lock b/pubspec.lock index c05ff6f..94ec65c 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -281,10 +281,10 @@ packages: dependency: "direct main" description: name: intl - sha256: "99f282cb0e02edcbbf8c6b3bbc7c90b65635156c412e58f3975a7e55284ce685" + sha256: "00f33b908655e606b86d2ade4710a231b802eec6f11e87e4ea3783fd72077a50" url: "https://pub.dev" source: hosted - version: "0.20.0" + version: "0.20.1" io: dependency: transitive description: @@ -545,10 +545,10 @@ packages: dependency: transitive description: name: shelf_web_socket - sha256: "073c147238594ecd0d193f3456a5fe91c4b0abbcc68bf5cd95b36c4e194ac611" + sha256: cc36c297b52866d203dbf9332263c94becc2fe0ceaa9681d07b6ef9807023b67 url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.0.1" sky_engine: dependency: transitive description: flutter @@ -582,10 +582,10 @@ packages: dependency: transitive description: name: sqflite_common - sha256: "4468b24876d673418a7b7147e5a08a715b4998a7ae69227acafaab762e0e5490" + sha256: "761b9740ecbd4d3e66b8916d784e581861fd3c3553eda85e167bc49fdb68f709" url: "https://pub.dev" source: hosted - version: "2.5.4+5" + version: "2.5.4+6" sqflite_darwin: dependency: transitive description: @@ -702,10 +702,10 @@ packages: dependency: transitive description: name: web - sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27" + sha256: cd3543bd5798f6ad290ea73d210f423502e71900302dde696f8bff84bf89a1cb url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "1.1.0" web_socket: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index b0bfc9b..1220156 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: expense_planner -description: Expese Planner is a flutter project.in this app your can track your weekly expanse. +description: Expese Planner is a flutter project. In this app your can track your weekly,monthly expanse. # The following line prevents the package from being accidentally published to # pub.dev using `pub publish`. This is preferred for private packages. @@ -18,12 +18,12 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev version: 1.1.1+1 environment: - sdk: ">=3.5.4 <4.0.0" + sdk: ">=3.5.4" dependencies: flutter: sdk: flutter - intl: ^0.20.0 + intl: ^0.20.1 sqflite: ^2.4.1 # The following adds the Cupertino Icons font to your application. @@ -49,7 +49,7 @@ flutter: # To add assets to your application, add an assets section, like this: assets: - - assets/images/slepping.png + - assets/images/ # - images/a_dot_ham.jpeg # An image asset can refer to one or more resolution-specific "variants", see