diff --git a/lib/main.dart b/lib/main.dart index 03eb2a7..661535a 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -79,15 +79,16 @@ class _MyHomePageState extends State { @override Widget build(BuildContext context) { - final MediaQueryData mediaQuery = MediaQuery.of(context); + final Orientation orientation = MediaQuery.orientationOf(context); + final EdgeInsets padding = MediaQuery.paddingOf(context); final Size size = MediaQuery.sizeOf(context); - final bool isLandscape = mediaQuery.orientation == Orientation.landscape; + final bool isLandscape = orientation == Orientation.landscape; final bool isDarkMode = Theme.of(context).brightness == Brightness.dark; final AppBar appBar = AppBar(title: Text('Personal Expenses', style: TextStyle(color: kColorScheme.onPrimary, fontSize: 20, fontFamily: 'Quicksand')), actions: [IconButton(onPressed: () => _addNewTransactionModal(context), icon: const Icon(Icons.add))]); final CupertinoNavigationBar iosAppBar = CupertinoNavigationBar(middle: const Text('Personal Expenses'), trailing: GestureDetector(onTap: () => _addNewTransactionModal(context), child: const Icon(CupertinoIcons.add))); - final SizedBox smallChartWidget = SizedBox(height: (size.height - appBar.preferredSize.height - mediaQuery.padding.top) * 0.3, child: Chart(recentTransactions: _recentTransactions)); - final SizedBox bigChartWidget = SizedBox(height: (size.height - appBar.preferredSize.height - mediaQuery.padding.top) * 0.7, child: Chart(recentTransactions: _recentTransactions)); - final SizedBox transactionWidget = SizedBox(height: (size.height - appBar.preferredSize.height - mediaQuery.padding.top) * 0.7, child: TransactionList(transactions: _transactions, deleteTransaction: _deleteTransaction, isDarkMode: isDarkMode)); + final SizedBox smallChartWidget = SizedBox(height: (size.height - appBar.preferredSize.height - padding.top) * 0.3, child: Chart(recentTransactions: _recentTransactions)); + final SizedBox bigChartWidget = SizedBox(height: (size.height - appBar.preferredSize.height - padding.top) * 0.7, child: Chart(recentTransactions: _recentTransactions)); + final SizedBox transactionWidget = SizedBox(height: (size.height - appBar.preferredSize.height - padding.top) * 0.7, child: TransactionList(transactions: _transactions, deleteTransaction: _deleteTransaction, isDarkMode: isDarkMode)); final SafeArea body = SafeArea( child: SingleChildScrollView( child: Column( diff --git a/lib/widgets/new_transaction.dart b/lib/widgets/new_transaction.dart index 4e0d489..c173268 100644 --- a/lib/widgets/new_transaction.dart +++ b/lib/widgets/new_transaction.dart @@ -41,7 +41,7 @@ class _NewTransactionState extends State { final bool isDarkMode = Theme.of(context).brightness == Brightness.dark; return SingleChildScrollView( child: Container( - padding: EdgeInsets.fromLTRB(10, 10, 10, MediaQuery.of(context).viewInsets.bottom + 10), + padding: EdgeInsets.fromLTRB(10, 10, 10, MediaQuery.viewInsetsOf(context).bottom + 10), child: Column( crossAxisAlignment: CrossAxisAlignment.end, children: [ diff --git a/pubspec.yaml b/pubspec.yaml index cba0852..9692deb 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: expense_tracker -description: "A new Flutter project." +description: "A simple and intuitive Flutter app to track your daily, weekly, and monthly expenses." # The following line prevents the package from being accidentally published to # pub.dev using `flutter pub publish`. This is preferred for private packages. publish_to: 'none' # Remove this line if you wish to publish to pub.dev @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.0.0+1 +version: 1.0.1+1 environment: sdk: ^3.7.0 diff --git a/web/index.html b/web/index.html index 35798be..927e82d 100644 --- a/web/index.html +++ b/web/index.html @@ -18,7 +18,7 @@ - + @@ -33,6 +33,6 @@ - +