From 4b4e24c575d07b9430841151ac3fd6c2adc7a392 Mon Sep 17 00:00:00 2001 From: GioErco03 <75883612+giovanni-ercolano@users.noreply.github.com> Date: Thu, 28 Sep 2023 15:13:01 +0200 Subject: [PATCH 1/9] implement light/dark mode, darkColors and more... create app_theme.dart, theme_provider.dart --- lib/constants/style.dart | 20 ++ lib/custom_widgets/alert_dialog.dart | 2 +- lib/custom_widgets/transactions_list.dart | 2 +- lib/main.dart | 110 +-------- .../general_options/general_settings.dart | 19 +- lib/pages/home_page.dart | 72 ++++-- lib/pages/statistics_page.dart | 202 ++++++++++------ lib/pages/structure.dart | 40 ++-- .../transactions_page/widgets/list_tab.dart | 2 +- lib/providers/theme_provider.dart | 22 ++ lib/routes.dart | 2 +- lib/utils/app_theme.dart | 224 ++++++++++++++++++ linux/flutter/generated_plugin_registrant.cc | 4 + linux/flutter/generated_plugins.cmake | 1 + macos/Flutter/GeneratedPluginRegistrant.swift | 2 + pubspec.lock | 76 +++++- .../flutter/generated_plugin_registrant.cc | 3 + windows/flutter/generated_plugins.cmake | 1 + 18 files changed, 577 insertions(+), 227 deletions(-) create mode 100644 lib/providers/theme_provider.dart create mode 100644 lib/utils/app_theme.dart diff --git a/lib/constants/style.dart b/lib/constants/style.dart index 6041d88..ec6e956 100644 --- a/lib/constants/style.dart +++ b/lib/constants/style.dart @@ -51,3 +51,23 @@ const account2 = Color(0xFFFB8500); const account3 = Color(0xFF356CA3); const account4 = Color(0xFF8ECAE6); const account5 = Color(0xFF3E9B12); + +//dark colors + +const darkGreen = Color(0xFF31B943); +const darkRed = Color(0xFFD83131); +const darkWhite = Color(0xFF181E25); +const darkBlack = Color(0xFFFFFFFF); + +const darkBlue1 = Color(0xFFE3E5E8); +const darkBlue2 = Color(0xFF002247); +const darkBlue3 = Color(0xFF012C5A); +const darkBlue4 = Color(0xFF033D78); +const darkBlue5 = Color(0xFF2C5987); +const darkBlue6 = Color(0xFF6C94BC); +const darkBlue7 = Color(0xFF181E25); + +const darkGrey1 = Color(0xFFA8AAAC); +const darkGrey2 = Color(0xFFC6C7C8); +const darkGrey3 = Color(0xFF181E25); +const darkGrey4 = Color(0xFF2E3338); diff --git a/lib/custom_widgets/alert_dialog.dart b/lib/custom_widgets/alert_dialog.dart index 70d3a14..3e0dd11 100644 --- a/lib/custom_widgets/alert_dialog.dart +++ b/lib/custom_widgets/alert_dialog.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import '/main.dart'; +import '../utils/app_theme.dart'; /// /// Builder class to create a customized dialog with some options diff --git a/lib/custom_widgets/transactions_list.dart b/lib/custom_widgets/transactions_list.dart index c45a1b2..0fdd349 100644 --- a/lib/custom_widgets/transactions_list.dart +++ b/lib/custom_widgets/transactions_list.dart @@ -181,7 +181,7 @@ class TransactionRow extends ConsumerWidget with Functions { children: [ Material( borderRadius: BorderRadius.circular(8), - color: Theme.of(context).colorScheme.background, + color: Theme.of(context).colorScheme.primaryContainer, child: InkWell( onTap: () { ref.read(selectedTransactionUpdateProvider.notifier).state = transaction; diff --git a/lib/main.dart b/lib/main.dart index 15d030b..55fac8e 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,116 +1,28 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:sossoldi/providers/theme_provider.dart'; +import 'package:sossoldi/utils/app_theme.dart'; import 'routes.dart'; import 'package:intl/date_symbol_data_local.dart'; -import 'constants/style.dart'; void main() { - initializeDateFormatting('it_IT', null).then((_) => runApp(const ProviderScope(child: Launcher()))); + initializeDateFormatting('it_IT', null) + .then((_) => runApp(const ProviderScope(child: Launcher()))); } -ColorScheme customColorScheme = const ColorScheme( - primary: blue1, - secondary: blue5, - surface: grey3, - background: white, - error: red, - onPrimary: white, - onSecondary: white, - onSurface: blue1, - onBackground: blue1, - onError: black, - brightness: Brightness.light, -); - -ThemeData customThemeData = ThemeData( - colorScheme: customColorScheme, - appBarTheme: const AppBarTheme( - color: grey3, - elevation: 0, - centerTitle: true, - iconTheme: IconThemeData(color: blue5), - titleTextStyle: TextStyle( - color: blue1, - fontSize: 18, - fontWeight: FontWeight.w700, - ), - ), - fontFamily: 'SF Pro Text', - textTheme: const TextTheme( - // display - displayLarge: TextStyle( - fontSize: 34.0, - fontWeight: FontWeight.w700, - ), - displayMedium: TextStyle( - fontSize: 34.0, - fontWeight: FontWeight.w600, - color: Colors.black, - ), - - // headline - headlineLarge: TextStyle( - fontSize: 24.0, - fontWeight: FontWeight.w700, - ), - headlineMedium: TextStyle( - fontSize: 24.0, - fontWeight: FontWeight.w600, - ), - - // title - titleLarge: TextStyle( - fontSize: 18.0, - fontWeight: FontWeight.w700, - ), - titleMedium: TextStyle( - fontSize: 18.0, - fontWeight: FontWeight.w600, - ), - titleSmall: TextStyle( - fontSize: 18.0, - fontWeight: FontWeight.w400, - ), - - // body - bodyLarge: TextStyle( - fontSize: 14.0, - fontWeight: FontWeight.w700, - ), - bodyMedium: TextStyle( - fontSize: 14.0, - fontWeight: FontWeight.w600, - ), - bodySmall: TextStyle( - fontSize: 14.0, - fontWeight: FontWeight.w400, - ), - - // label - labelLarge: TextStyle( - fontSize: 10.0, - fontWeight: FontWeight.w700, - ), - labelMedium: TextStyle( - fontSize: 10.0, - fontWeight: FontWeight.w400, - ), - labelSmall: TextStyle( - fontSize: 8.0, - fontWeight: FontWeight.w700, - ), - ), -); - -class Launcher extends StatelessWidget { +class Launcher extends ConsumerWidget { const Launcher({super.key}); // This widget is the root of your application. @override - Widget build(BuildContext context) { + Widget build(BuildContext context, WidgetRef ref) { + final appThemeState = ref.watch(appThemeStateNotifier); return MaterialApp( title: 'Sossoldi', - theme: customThemeData, + theme: AppTheme.lightTheme, + darkTheme: AppTheme.darkTheme, + themeMode: + appThemeState.isDarkModeEnabled ? ThemeMode.dark : ThemeMode.light, onGenerateRoute: makeRoute, initialRoute: '/', ); diff --git a/lib/pages/general_options/general_settings.dart b/lib/pages/general_options/general_settings.dart index fcf93fa..f62717f 100644 --- a/lib/pages/general_options/general_settings.dart +++ b/lib/pages/general_options/general_settings.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:intl/intl.dart'; +import 'package:sossoldi/providers/theme_provider.dart'; import '../../constants/style.dart'; @@ -35,6 +36,7 @@ class _GeneralSettingsPageState extends ConsumerState { @override Widget build(BuildContext context) { + final appThemeState = ref.watch(appThemeStateNotifier); return Scaffold( appBar: AppBar( backgroundColor: Theme.of(context).colorScheme.background, @@ -75,12 +77,21 @@ class _GeneralSettingsPageState extends ConsumerState { child: IconButton( color: blue5, onPressed: () { - setState(() { - darkMode = !darkMode; - }); + // Toggle dark mode using the provider + if (appThemeState.isDarkModeEnabled) { + ref + .read(appThemeStateNotifier.notifier) + .setLightTheme(); + } else { + ref + .read(appThemeStateNotifier.notifier) + .setDarkTheme(); + } }, icon: Icon( - darkMode ? Icons.dark_mode : Icons.light_mode, + appThemeState.isDarkModeEnabled + ? Icons.dark_mode + : Icons.light_mode, size: 25.0, color: Theme.of(context).colorScheme.background, ), diff --git a/lib/pages/home_page.dart b/lib/pages/home_page.dart index a1a649b..ed0c513 100644 --- a/lib/pages/home_page.dart +++ b/lib/pages/home_page.dart @@ -19,7 +19,6 @@ class HomePage extends ConsumerStatefulWidget { } class _HomePageState extends ConsumerState with Functions { - @override Widget build(BuildContext context) { final accountList = ref.watch(accountsProvider); @@ -37,10 +36,8 @@ class _HomePageState extends ConsumerState with Functions { children: [ Text( "MONTHLY BALANCE", - style: Theme.of(context) - .textTheme - .labelMedium - ?.copyWith(color: Theme.of(context).colorScheme.primary), + style: Theme.of(context).textTheme.labelMedium?.copyWith( + color: Theme.of(context).colorScheme.primary), ), RichText( textScaleFactor: MediaQuery.of(context).textScaleFactor, @@ -51,14 +48,18 @@ class _HomePageState extends ConsumerState with Functions { style: Theme.of(context) .textTheme .headlineLarge - ?.copyWith(color: Theme.of(context).colorScheme.primary), + ?.copyWith( + color: + Theme.of(context).colorScheme.primary), ), TextSpan( text: "€", style: Theme.of(context) .textTheme .bodyLarge - ?.copyWith(color: Theme.of(context).colorScheme.primary), + ?.copyWith( + color: + Theme.of(context).colorScheme.primary), ), ], ), @@ -79,11 +80,17 @@ class _HomePageState extends ConsumerState with Functions { children: [ TextSpan( text: numToCurrency(1050.65), - style: Theme.of(context).textTheme.bodyMedium?.copyWith(color: green), + style: Theme.of(context) + .textTheme + .bodyMedium + ?.copyWith(color: green), ), TextSpan( text: "€", - style: Theme.of(context).textTheme.labelLarge?.copyWith(color: green), + style: Theme.of(context) + .textTheme + .labelLarge + ?.copyWith(color: green), ), ], ), @@ -104,11 +111,17 @@ class _HomePageState extends ConsumerState with Functions { children: [ TextSpan( text: numToCurrency(-1050.65), - style: Theme.of(context).textTheme.bodyMedium?.copyWith(color: red), + style: Theme.of(context) + .textTheme + .bodyMedium + ?.copyWith(color: red), ), TextSpan( text: "€", - style: Theme.of(context).textTheme.labelLarge?.copyWith(color: red), + style: Theme.of(context) + .textTheme + .labelLarge + ?.copyWith(color: red), ), ], ), @@ -172,7 +185,7 @@ class _HomePageState extends ConsumerState with Functions { FlSpot(29, 4.7), FlSpot(30, 1), ], - colorLine2Data: Color(0xffB9BABC), + colorLine2Data: Color(0xffB9BABC), //da modificare in darkMode colorBackground: Color(0xffF1F5F9), maxY: 5.0, minY: -5.0, @@ -220,9 +233,11 @@ class _HomePageState extends ConsumerState with Functions { ], ), Container( - decoration: const BoxDecoration( - color: white, - borderRadius: BorderRadius.only( + decoration: BoxDecoration( + color: Theme.of(context) + .colorScheme + .primaryContainer, //da modificare in darkMode + borderRadius: const BorderRadius.only( topLeft: Radius.circular(16), topRight: Radius.circular(16), ), @@ -257,7 +272,8 @@ class _HomePageState extends ConsumerState with Functions { ), child: TextButton.icon( style: ButtonStyle( - maximumSize: MaterialStateProperty.all(const Size(130, 48)), + maximumSize: MaterialStateProperty.all( + const Size(130, 48)), backgroundColor: MaterialStateProperty.all( Theme.of(context).colorScheme.surface), shape: MaterialStateProperty.all( @@ -269,24 +285,31 @@ class _HomePageState extends ConsumerState with Functions { icon: Container( decoration: const BoxDecoration( shape: BoxShape.circle, - color: grey1, + color: blue5, ), - child: Padding( - padding: const EdgeInsets.all(5.0), + child: const Padding( + padding: EdgeInsets.all(5.0), child: Icon( Icons.add_rounded, size: 24.0, - color: Theme.of(context).colorScheme.surface, + color: white, ), ), ), label: Text( "New Account", - style: - Theme.of(context).textTheme.bodyLarge!.copyWith(color: grey1), + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + color: Theme.of(context) + .colorScheme + .tertiary, + ), maxLines: 2, ), - onPressed: () => Navigator.of(context).pushNamed('/add-account'), + onPressed: () => Navigator.of(context) + .pushNamed('/add-account'), ), ), ); @@ -311,7 +334,8 @@ class _HomePageState extends ConsumerState with Functions { ), ), transactionList.when( - data: (transactions) => TransactionsList(transactions: transactions), + data: (transactions) => + TransactionsList(transactions: transactions), loading: () => const SizedBox(), error: (err, stack) => Text('Error: $err'), ), diff --git a/lib/pages/statistics_page.dart b/lib/pages/statistics_page.dart index 43d0913..eee5e85 100644 --- a/lib/pages/statistics_page.dart +++ b/lib/pages/statistics_page.dart @@ -8,7 +8,6 @@ import 'package:fl_chart/fl_chart.dart'; import '../model/bank_account.dart'; import '../providers/accounts_provider.dart'; - class StatsPage extends ConsumerStatefulWidget { const StatsPage({super.key}); @@ -17,7 +16,6 @@ class StatsPage extends ConsumerStatefulWidget { } class _StatsPageState extends ConsumerState with Functions { - @override Widget build(BuildContext context) { final accountList = ref.watch(accountsProvider); @@ -35,13 +33,10 @@ class _StatsPageState extends ConsumerState with Functions { children: [ Text( "Available liquidity", - style: Theme.of(context) - .textTheme - .headline6 - ?.copyWith( + style: Theme.of(context).textTheme.titleLarge?.copyWith( color: Theme.of(context).colorScheme.primary, fontWeight: FontWeight.w600, - ), + ), ), ], ), @@ -55,12 +50,17 @@ class _StatsPageState extends ConsumerState with Functions { children: [ TextSpan( text: "10.635", - style: Theme.of(context).textTheme.headlineLarge?.copyWith(color: blue4), + style: Theme.of(context) + .textTheme + .headlineLarge + ?.copyWith(color: blue4), ), TextSpan( - text: "€", - style: Theme.of(context).textTheme.labelLarge?.copyWith(color: blue4) - ), + text: "€", + style: Theme.of(context) + .textTheme + .labelLarge + ?.copyWith(color: blue4)), ], ), ), @@ -70,11 +70,18 @@ class _StatsPageState extends ConsumerState with Functions { children: [ TextSpan( text: "+6%", - style: Theme.of(context).textTheme.bodyMedium?.copyWith(color: green, fontWeight: FontWeight.w600), + style: Theme.of(context) + .textTheme + .bodyMedium + ?.copyWith( + color: green, fontWeight: FontWeight.w600), ), TextSpan( text: " VS last month", - style: Theme.of(context).textTheme.labelLarge?.copyWith(fontWeight: FontWeight.w300), + style: Theme.of(context) + .textTheme + .labelLarge + ?.copyWith(fontWeight: FontWeight.w300), ), ], ), @@ -111,13 +118,10 @@ class _StatsPageState extends ConsumerState with Functions { padding: const EdgeInsets.only(left: 8.0, top: 8.0), child: Text( "Accounts", - style: Theme.of(context) - .textTheme - .headline6 - ?.copyWith( + style: Theme.of(context).textTheme.titleLarge?.copyWith( color: Theme.of(context).colorScheme.primary, fontWeight: FontWeight.w600, - ), + ), textAlign: TextAlign.left, ), ), @@ -129,7 +133,8 @@ class _StatsPageState extends ConsumerState with Functions { child: ListView.builder( itemCount: accounts.length, shrinkWrap: true, - padding: const EdgeInsets.only(left: 16.0, right: 16.0, top: 8.0), + padding: const EdgeInsets.only( + left: 16.0, right: 16.0, top: 8.0), physics: const BouncingScrollPhysics(), scrollDirection: Axis.vertical, itemBuilder: (context, i) { @@ -146,71 +151,118 @@ class _StatsPageState extends ConsumerState with Functions { } else { BankAccount account = accounts[i]; double max = 0; - for(var i = 0; i < accounts.length; i++) - { - if (max <= accounts[i].startingValue){max = accounts[i].startingValue.toDouble();} + for (var i = 0; i < accounts.length; i++) { + if (max <= accounts[i].startingValue) { + max = accounts[i].startingValue.toDouble(); + } } return SizedBox( - height: 50.0, - child: Column( - children: [ - const Padding(padding: EdgeInsets.all(2.0)), - Row( - children: [ - RichText( - textScaleFactor: MediaQuery.of(context).textScaleFactor, - text: TextSpan( - children: [ - TextSpan( - text: account.name, - style: Theme.of(context).textTheme.bodySmall?.copyWith(color: blue1), - ), - ], - ), - ), - Expanded( - child: Text( - "${account.startingValue}€", - textAlign: TextAlign.right, - style: Theme.of(context).textTheme.bodySmall?.copyWith(color: blue1), - ), - ), - ], - ), - const Padding(padding: EdgeInsets.only(top: 4.0)), - SizedBox( - height: 12, - width: double.infinity, - child: Row( + height: 50.0, + child: Column( + children: [ + const Padding(padding: EdgeInsets.all(2.0)), + Row( children: [ - Container( - width: MediaQuery.of(context).size.width * 0.9 * (account.startingValue.toDouble()/max) - (account.startingValue.toDouble()/max > 0 ? 1 : 0), - decoration: BoxDecoration( - borderRadius: BorderRadius.only( - topLeft: const Radius.circular(4.0), - bottomLeft: const Radius.circular(4.0), - topRight: Radius.circular(account.startingValue.toDouble()/max == 1 ? 4.0 : 0.0), - bottomRight: Radius.circular(account.startingValue.toDouble()/max == 1 ? 4.0 : 0.0), - ), - color: blue3, + RichText( + textScaleFactor: MediaQuery.of(context) + .textScaleFactor, + text: TextSpan( + children: [ + TextSpan( + text: account.name, + style: Theme.of(context) + .textTheme + .bodySmall + ?.copyWith(color: blue1), + ), + ], ), ), - Container( - width: account.startingValue.toDouble()/max == 1 ? 0 : MediaQuery.of(context).size.width * 0.9 * (1 - (account.startingValue.toDouble()/max)) - 1, - decoration: const BoxDecoration( - borderRadius: BorderRadius.only( - topRight: Radius.circular(4.0), - bottomRight: Radius.circular(4.0), - ), - color: blue7, + Expanded( + child: Text( + "${account.startingValue}€", + textAlign: TextAlign.right, + style: Theme.of(context) + .textTheme + .bodySmall + ?.copyWith(color: blue1), ), ), ], ), - ) - ], - ) - ); + const Padding( + padding: EdgeInsets.only(top: 4.0)), + SizedBox( + height: 12, + width: double.infinity, + child: Row( + children: [ + Container( + width: MediaQuery.of(context) + .size + .width * + 0.9 * + (account.startingValue + .toDouble() / + max) - + (account.startingValue + .toDouble() / + max > + 0 + ? 1 + : 0), + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topLeft: + const Radius.circular(4.0), + bottomLeft: + const Radius.circular(4.0), + topRight: Radius.circular(account + .startingValue + .toDouble() / + max == + 1 + ? 4.0 + : 0.0), + bottomRight: Radius.circular( + account.startingValue + .toDouble() / + max == + 1 + ? 4.0 + : 0.0), + ), + color: blue3, + ), + ), + Container( + width: account.startingValue + .toDouble() / + max == + 1 + ? 0 + : MediaQuery.of(context) + .size + .width * + 0.9 * + (1 - + (account.startingValue + .toDouble() / + max)) - + 1, + decoration: const BoxDecoration( + borderRadius: BorderRadius.only( + topRight: Radius.circular(4.0), + bottomRight: Radius.circular(4.0), + ), + color: blue7, + ), + ), + ], + ), + ) + ], + )); } }, ), diff --git a/lib/pages/structure.dart b/lib/pages/structure.dart index 216f8fc..a773216 100644 --- a/lib/pages/structure.dart +++ b/lib/pages/structure.dart @@ -2,7 +2,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import '../constants/style.dart'; import 'add_page/add_page.dart'; import '../pages/home_page.dart'; import '../pages/transactions_page/transactions_page.dart'; @@ -29,29 +28,27 @@ class _StructureState extends ConsumerState { ]; final List _pages = [ const HomePage(), - TransactionsPage(), + const TransactionsPage(), const SizedBox(), - PlanningPage(), - StatsPage(), + const PlanningPage(), + const StatsPage(), ]; @override Widget build(BuildContext context) { final selectedIndex = ref.watch(selectedIndexProvider); return Scaffold( - backgroundColor: blue7, - resizeToAvoidBottomInset: false, // Prevent the fab moving up when the keyboard is opened + // backgroundColor: blue7, + resizeToAvoidBottomInset: + false, // Prevent the fab moving up when the keyboard is opened appBar: AppBar( // Sulla dashboard (0) setto il background blue - backgroundColor: selectedIndex == 0 ? blue7 : Theme.of(context).colorScheme.background, + // backgroundColor: selectedIndex == 0 ? blue7 : Theme.of(context).colorScheme.background, elevation: 0, centerTitle: true, title: Text( _pagesTitle.elementAt(selectedIndex), - style: Theme.of(context) - .textTheme - .headlineLarge! - .copyWith(color: Theme.of(context).colorScheme.primary), + style: Theme.of(context).textTheme.headlineLarge!, ), leading: Padding( padding: const EdgeInsets.only(left: 16), @@ -94,13 +91,14 @@ class _StructureState extends ConsumerState { bottomNavigationBar: BottomNavigationBar( type: BottomNavigationBarType.fixed, selectedItemColor: Theme.of(context).colorScheme.primary, - unselectedItemColor: grey1, + // unselectedItemColor: grey1, selectedFontSize: 8, unselectedFontSize: 8, - backgroundColor: const Color(0xFFF6F6F6), + // backgroundColor: const Color(0xFFF6F6F6), currentIndex: selectedIndex, - onTap: (index) => - index != 2 ? ref.read(selectedIndexProvider.notifier).state = index : null, + onTap: (index) => index != 2 + ? ref.read(selectedIndexProvider.notifier).state = index + : null, items: [ BottomNavigationBarItem( icon: Icon(selectedIndex == 0 ? Icons.home : Icons.home_outlined), @@ -114,12 +112,15 @@ class _StructureState extends ConsumerState { ), const BottomNavigationBarItem(icon: Text(""), label: ""), BottomNavigationBarItem( - icon: Icon(selectedIndex == 3 ? Icons.calendar_today : Icons.calendar_today_outlined), + icon: Icon(selectedIndex == 3 + ? Icons.calendar_today + : Icons.calendar_today_outlined), label: "PLANNING", ), BottomNavigationBarItem( - icon: - Icon(selectedIndex == 4 ? Icons.data_exploration : Icons.data_exploration_outlined), + icon: Icon(selectedIndex == 4 + ? Icons.data_exploration + : Icons.data_exploration_outlined), label: "GRAPHS", ), ], @@ -160,7 +161,8 @@ class _StructureState extends ConsumerState { ); }, ), - floatingActionButtonLocation: FloatingActionButtonLocation.miniCenterDocked, + floatingActionButtonLocation: + FloatingActionButtonLocation.miniCenterDocked, ); } } diff --git a/lib/pages/transactions_page/widgets/list_tab.dart b/lib/pages/transactions_page/widgets/list_tab.dart index 4d2d46a..b551a91 100644 --- a/lib/pages/transactions_page/widgets/list_tab.dart +++ b/lib/pages/transactions_page/widgets/list_tab.dart @@ -44,7 +44,7 @@ class _ListTabState extends ConsumerState with Functions { return Container( margin: const EdgeInsets.symmetric(horizontal: 8.0), padding: const EdgeInsets.symmetric(horizontal: 12.0), - color: grey3, + color: Theme.of(context).colorScheme.primaryContainer, // da sistemare prima il layout della pagina child: transactions.when( data: (data) { return ListView.separated( diff --git a/lib/providers/theme_provider.dart b/lib/providers/theme_provider.dart new file mode 100644 index 0000000..d8dba5f --- /dev/null +++ b/lib/providers/theme_provider.dart @@ -0,0 +1,22 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +// import 'package:hooks_riverpod/hooks_riverpod.dart'; + +final appThemeStateNotifier = ChangeNotifierProvider( + (ref) => AppThemeState(), +); + +class AppThemeState extends ChangeNotifier { + var isDarkModeEnabled = false; + + void setLightTheme(){ + isDarkModeEnabled = false; + notifyListeners(); + } + + void setDarkTheme(){ + isDarkModeEnabled = true; + notifyListeners(); + } +} \ No newline at end of file diff --git a/lib/routes.dart b/lib/routes.dart index bf1c16c..2c35c59 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -26,7 +26,7 @@ Route makeRoute(RouteSettings settings) { case '/dashboard': return _materialPageRoute(settings.name, const HomePage()); case '/transactions': - return _materialPageRoute(settings.name, TransactionsPage()); + return _materialPageRoute(settings.name, const TransactionsPage()); case '/categoryselect': return _cupertinoPageRoute(settings.name, const CategorySelector()); case '/category-list': diff --git a/lib/utils/app_theme.dart b/lib/utils/app_theme.dart new file mode 100644 index 0000000..6d0cb21 --- /dev/null +++ b/lib/utils/app_theme.dart @@ -0,0 +1,224 @@ +import 'package:flutter/material.dart'; + +import '../constants/style.dart'; + +class AppTheme { + static final lightTheme = ThemeData( + colorScheme: customColorScheme, + scaffoldBackgroundColor: blue7, + appBarTheme: const AppBarTheme( + color: grey3, + elevation: 0, + centerTitle: true, + iconTheme: IconThemeData(color: blue5), + titleTextStyle: TextStyle( + color: blue1, + fontSize: 18, + fontWeight: FontWeight.w700, + ), + ), + bottomNavigationBarTheme: const BottomNavigationBarThemeData( + backgroundColor: blue7, + unselectedItemColor: grey1, + ), + iconTheme: const IconThemeData( + color: blue1, + ), + fontFamily: 'SF Pro Text', + textTheme: const TextTheme( + // display + displayLarge: TextStyle( + fontSize: 34.0, + fontWeight: FontWeight.w700, + ), + displayMedium: TextStyle( + fontSize: 34.0, + fontWeight: FontWeight.w600, + color: Colors.black, + ), + + // headline + headlineLarge: TextStyle( + fontSize: 24.0, + fontWeight: FontWeight.w700, + ), + headlineMedium: TextStyle( + fontSize: 24.0, + fontWeight: FontWeight.w600, + ), + + // title + titleLarge: TextStyle( + fontSize: 18.0, + fontWeight: FontWeight.w700, + ), + titleMedium: TextStyle( + fontSize: 18.0, + fontWeight: FontWeight.w600, + ), + titleSmall: TextStyle( + fontSize: 18.0, + fontWeight: FontWeight.w400, + ), + + // body + bodyLarge: TextStyle( + fontSize: 14.0, + fontWeight: FontWeight.w700, + ), + bodyMedium: TextStyle( + fontSize: 14.0, + fontWeight: FontWeight.w600, + ), + bodySmall: TextStyle( + fontSize: 14.0, + fontWeight: FontWeight.w400, + ), + + // label + labelLarge: TextStyle( + fontSize: 10.0, + fontWeight: FontWeight.w700, + ), + labelMedium: TextStyle( + fontSize: 10.0, + fontWeight: FontWeight.w400, + ), + labelSmall: TextStyle( + fontSize: 8.0, + fontWeight: FontWeight.w700, + ), + )); + + static final darkTheme = ThemeData( + colorScheme: darkCustomColorScheme, + scaffoldBackgroundColor: darkBlue7, + appBarTheme: const AppBarTheme( + color: darkGrey3, + elevation: 0, + centerTitle: true, + iconTheme: IconThemeData(color: darkBlue5), + titleTextStyle: TextStyle( + color: darkBlue1, + fontSize: 18, + fontWeight: FontWeight.w700, + ), + ), + bottomNavigationBarTheme: const BottomNavigationBarThemeData( + backgroundColor: darkBlue7, + unselectedItemColor: darkGrey1, + ), + + tabBarTheme: const TabBarTheme(indicator: BoxDecoration(color: darkBlue5)), + + iconTheme: const IconThemeData( + color: darkBlue1, + ), + + //Text style + fontFamily: 'SF Pro Text', + textTheme: const TextTheme( + displayLarge: TextStyle( + fontSize: 34.0, fontWeight: FontWeight.w700, color: darkBlack), + displayMedium: TextStyle( + fontSize: 34.0, + fontWeight: FontWeight.w600, + color: darkBlack, + ), + // headline + headlineLarge: TextStyle( + fontSize: 24.0, + fontWeight: FontWeight.w700, + color: darkBlack, + ), + headlineMedium: TextStyle( + fontSize: 24.0, + fontWeight: FontWeight.w600, + color: darkBlack, + ), + + // title + titleLarge: TextStyle( + fontSize: 18.0, + fontWeight: FontWeight.w700, + color: darkBlack, + ), + titleMedium: TextStyle( + fontSize: 18.0, + fontWeight: FontWeight.w600, + color: darkBlack, + ), + titleSmall: TextStyle( + fontSize: 18.0, + fontWeight: FontWeight.w400, + color: darkBlack, + ), + + // body + bodyLarge: TextStyle( + fontSize: 14.0, + fontWeight: FontWeight.w700, + color: darkBlack, + ), + bodyMedium: TextStyle( + fontSize: 14.0, + fontWeight: FontWeight.w600, + color: darkBlack, + ), + bodySmall: TextStyle( + fontSize: 14.0, + fontWeight: FontWeight.w400, + color: darkBlack, + ), + + // label + labelLarge: TextStyle( + fontSize: 10.0, + fontWeight: FontWeight.w700, + color: darkBlack, + ), + labelMedium: TextStyle( + fontSize: 10.0, + fontWeight: FontWeight.w400, + color: darkBlack, + ), + labelSmall: TextStyle( + fontSize: 8.0, + fontWeight: FontWeight.w700, + color: darkBlack, + ), + ), + ); +} + +ColorScheme customColorScheme = const ColorScheme( + primary: blue1, + primaryContainer: white, + secondary: blue5, + tertiary: blue4, + surface: grey3, + background: white, + error: red, + onPrimary: white, + onSecondary: white, + onSurface: blue1, + onBackground: blue1, + onError: black, + brightness: Brightness.light, +); + +ColorScheme darkCustomColorScheme = const ColorScheme( + primary: darkBlue1, + primaryContainer: darkGrey4, + secondary: darkBlue5, + tertiary: darkBlack, + surface: darkBlue7, //darkBlue3 + background: darkWhite, + error: darkRed, + onPrimary: darkWhite, + onSecondary: darkWhite, + onSurface: darkBlue1, + onBackground: darkBlue1, + onError: darkBlack, + brightness: Brightness.dark, +); diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index 2c1ec4f..4c0025f 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -7,9 +7,13 @@ #include "generated_plugin_registrant.h" #include +#include void fl_register_plugins(FlPluginRegistry* registry) { g_autoptr(FlPluginRegistrar) sqlite3_flutter_libs_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "Sqlite3FlutterLibsPlugin"); sqlite3_flutter_libs_plugin_register_with_registrar(sqlite3_flutter_libs_registrar); + g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); + url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); } diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index 7ea2a80..ad279a8 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -4,6 +4,7 @@ list(APPEND FLUTTER_PLUGIN_LIST sqlite3_flutter_libs + url_launcher_linux ) list(APPEND FLUTTER_FFI_PLUGIN_LIST diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 4856abc..b4e2147 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -7,8 +7,10 @@ import Foundation import sqflite import sqlite3_flutter_libs +import url_launcher_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) Sqlite3FlutterLibsPlugin.register(with: registry.registrar(forPlugin: "Sqlite3FlutterLibsPlugin")) + UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) } diff --git a/pubspec.lock b/pubspec.lock index a6cffac..bceddd9 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -400,6 +400,14 @@ packages: url: "https://pub.dev" source: hosted version: "5.1.0" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: da3fdfeccc4d4ff2da8f8c556704c08f912542c5fb3cf2233ed75372384a034d + url: "https://pub.dev" + source: hosted + version: "2.1.6" pointycastle: dependency: transitive description: @@ -621,6 +629,70 @@ packages: url: "https://pub.dev" source: hosted version: "2.2.0" + url_launcher: + dependency: "direct main" + description: + name: url_launcher + sha256: eb1e00ab44303d50dd487aab67ebc575456c146c6af44422f9c13889984c00f3 + url: "https://pub.dev" + source: hosted + version: "6.1.11" + url_launcher_android: + dependency: transitive + description: + name: url_launcher_android + sha256: b04af59516ab45762b2ca6da40fa830d72d0f6045cd97744450b73493fa76330 + url: "https://pub.dev" + source: hosted + version: "6.1.0" + url_launcher_ios: + dependency: transitive + description: + name: url_launcher_ios + sha256: "7c65021d5dee51813d652357bc65b8dd4a6177082a9966bc8ba6ee477baa795f" + url: "https://pub.dev" + source: hosted + version: "6.1.5" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + sha256: b651aad005e0cb06a01dbd84b428a301916dc75f0e7ea6165f80057fee2d8e8e + url: "https://pub.dev" + source: hosted + version: "3.0.6" + url_launcher_macos: + dependency: transitive + description: + name: url_launcher_macos + sha256: b55486791f666e62e0e8ff825e58a023fd6b1f71c49926483f1128d3bbd8fe88 + url: "https://pub.dev" + source: hosted + version: "3.0.7" + url_launcher_platform_interface: + dependency: transitive + description: + name: url_launcher_platform_interface + sha256: "95465b39f83bfe95fcb9d174829d6476216f2d548b79c38ab2506e0458787618" + url: "https://pub.dev" + source: hosted + version: "2.1.5" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + sha256: ba140138558fcc3eead51a1c42e92a9fb074a1b1149ed3c73e66035b2ccd94f2 + url: "https://pub.dev" + source: hosted + version: "2.0.19" + url_launcher_windows: + dependency: transitive + description: + name: url_launcher_windows + sha256: "95fef3129dc7cfaba2bc3d5ba2e16063bb561fc6d78e63eee16162bc70029069" + url: "https://pub.dev" + source: hosted + version: "3.0.8" vector_math: dependency: transitive description: @@ -678,5 +750,5 @@ packages: source: hosted version: "3.1.1" sdks: - dart: ">=2.18.0 <3.0.0" - flutter: ">=3.3.0" \ No newline at end of file + dart: ">=2.19.0 <3.0.0" + flutter: ">=3.7.0" diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 988f3c8..76d5285 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -7,8 +7,11 @@ #include "generated_plugin_registrant.h" #include +#include void RegisterPlugins(flutter::PluginRegistry* registry) { Sqlite3FlutterLibsPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("Sqlite3FlutterLibsPlugin")); + UrlLauncherWindowsRegisterWithRegistrar( + registry->GetRegistrarForPlugin("UrlLauncherWindows")); } diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 8abff95..22aeaae 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -4,6 +4,7 @@ list(APPEND FLUTTER_PLUGIN_LIST sqlite3_flutter_libs + url_launcher_windows ) list(APPEND FLUTTER_FFI_PLUGIN_LIST From 0ece0766831f71b7d67651da6d5e0c570ce64654 Mon Sep 17 00:00:00 2001 From: GioErco03 <75883612+giovanni-ercolano@users.noreply.github.com> Date: Thu, 19 Oct 2023 19:41:47 +0200 Subject: [PATCH 2/9] fix account list home color and icon color general settings --- android/build.gradle | 2 +- lib/constants/constants.dart | 33 +++++++++++++++++ lib/constants/style.dart | 19 +++++++++- lib/custom_widgets/accounts_sum.dart | 36 +++++++++++++------ lib/custom_widgets/transactions_list.dart | 2 +- lib/pages/accounts/account_list.dart | 2 +- lib/pages/accounts/add_account.dart | 12 +++---- .../add_page/widgets/account_selector.dart | 4 +-- .../add_page/widgets/category_selector.dart | 4 +-- lib/pages/categories/add_category.dart | 12 +++---- lib/pages/categories/category_list.dart | 2 +- .../general_options/general_settings.dart | 11 ++++-- lib/providers/theme_provider.dart | 12 ++++--- 13 files changed, 111 insertions(+), 40 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 8ac4d8e..9bc02fa 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -26,6 +26,6 @@ subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir } diff --git a/lib/constants/constants.dart b/lib/constants/constants.dart index def1849..5d43ca1 100644 --- a/lib/constants/constants.dart +++ b/lib/constants/constants.dart @@ -43,6 +43,18 @@ const categoryColorList = [ category10, ]; +const darkCategoryColorList = [ + darkCategory1, + darkCategory2, + darkCategory3, + darkCategory4, + darkCategory5, + darkCategory6, + darkCategory7, + darkCategory8, + darkCategory9, +]; + const accountColorList = [ account1, account2, @@ -50,3 +62,24 @@ const accountColorList = [ account4, account5, ]; + +const darkAccountColorList = [ + darkAccount1, + darkAccount2, + darkAccount3, + darkAccount4, + darkAccount5, +]; + +List categoryColorListTheme = categoryColorList; +List accountColorListTheme = accountColorList; + +void updateColorsBasedOnTheme(bool isDarkModeEnabled) { + if (isDarkModeEnabled) { + categoryColorListTheme = darkCategoryColorList; + accountColorListTheme = darkAccountColorList; + } else { + categoryColorListTheme = categoryColorList; + accountColorListTheme = accountColorList; + } +} diff --git a/lib/constants/style.dart b/lib/constants/style.dart index ec6e956..2c11995 100644 --- a/lib/constants/style.dart +++ b/lib/constants/style.dart @@ -41,7 +41,7 @@ const category3 = Color(0xFFFF4754); const category4 = Color(0xFFD336B6); const category5 = Color(0xFF7236D3); const category6 = Color(0xFF2675E3); -const category7 = Color(0xFF16ADDF); +const category7 = Color(0xFF16ADDF);//inesistente sul figma const category8 = Color(0xFF12BFCE); const category9 = Color(0xFF12BA95); const category10 = Color(0xFF0BC11D); @@ -71,3 +71,20 @@ const darkGrey1 = Color(0xFFA8AAAC); const darkGrey2 = Color(0xFFC6C7C8); const darkGrey3 = Color(0xFF181E25); const darkGrey4 = Color(0xFF2E3338); + +const darkCategory1 = Color(0xFFE3B912); +const darkCategory2 = Color(0xFFF6740C); +const darkCategory3 = Color(0xFFFA3240); +const darkCategory4 = Color(0xFFBF2AA4); +const darkCategory5 = Color(0xFF672BC7); +const darkCategory6 = Color(0xFF1B6BD9); +const darkCategory7 = Color(0xFF0FB1C0); +const darkCategory8 = Color(0xFF0EB38F); +const darkCategory9 = Color(0xFF0AAF1A); +// const darkCategory10 = Color(0xFF); + +const darkAccount1 = Color(0xFFE0A30C); +const darkAccount2 = Color(0xFFDC7807); +const darkAccount3 = Color(0xFF33679B); +const darkAccount4 = Color(0xFF61B4DB); +const darkAccount5 = Color(0xFF398F10); \ No newline at end of file diff --git a/lib/custom_widgets/accounts_sum.dart b/lib/custom_widgets/accounts_sum.dart index b5bb177..61029b8 100644 --- a/lib/custom_widgets/accounts_sum.dart +++ b/lib/custom_widgets/accounts_sum.dart @@ -27,7 +27,7 @@ class AccountsSum extends StatelessWidget with Functions { ), child: Container( decoration: BoxDecoration( - color: accountColorList[account.color].withOpacity(0.2), + color: accountColorListTheme[account.color].withOpacity(0.2), borderRadius: BorderRadius.circular(8), ), child: Material( @@ -72,26 +72,33 @@ class AccountsSum extends StatelessWidget with Functions { Container( decoration: BoxDecoration( shape: BoxShape.circle, - color: accountColorList[account.color], + color: accountColorListTheme[account.color], ), child: Padding( padding: const EdgeInsets.all(6.0), - child: Icon(accountIconList[account.symbol], size: 20.0, color: white), + child: Icon(accountIconList[account.symbol], + size: 20.0, + color: white), //capire se cambiare colore icona ), ), Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.end, children: [ - Text(account.name, style: Theme.of(context).textTheme.bodyLarge), + Text(account.name, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith(color: darkBlue7)),//impostato manualmente darkBlue7, da rivedere FutureBuilder( future: BankAccountMethods().getAccountSum(account.id), builder: (context, snapshot) { - if (snapshot.connectionState == ConnectionState.waiting) { + if (snapshot.connectionState == + ConnectionState.waiting) { // Show a loading indicator while waiting for the future to complete return Transform.scale( scale: 0.5, - child: CircularProgressIndicator(), + child: const CircularProgressIndicator(), ); } else if (snapshot.hasError) { // Show an error message if the future encounters an error @@ -100,18 +107,25 @@ class AccountsSum extends StatelessWidget with Functions { // Display the result once the future completes successfully final accountSum = snapshot.data ?? 0; return RichText( - textScaleFactor: MediaQuery.of(context).textScaleFactor, + textScaleFactor: + MediaQuery.of(context).textScaleFactor, text: TextSpan( children: [ TextSpan( text: numToCurrency(accountSum), - style: Theme.of(context).textTheme.titleSmall, + style: + Theme.of(context).textTheme.titleSmall!.copyWith(color: darkBlue7), ), TextSpan( text: "€", - style: Theme.of(context).textTheme.bodyMedium?.apply( - fontFeatures: [const FontFeature.subscripts()], - ), + style: Theme.of(context) + .textTheme + .bodyMedium + ?.apply( + fontFeatures: [ + const FontFeature.subscripts() + ], + ).copyWith(color: darkBlue7), ), ], ), diff --git a/lib/custom_widgets/transactions_list.dart b/lib/custom_widgets/transactions_list.dart index 0fdd349..ac8862d 100644 --- a/lib/custom_widgets/transactions_list.dart +++ b/lib/custom_widgets/transactions_list.dart @@ -224,7 +224,7 @@ class TransactionRow extends ConsumerWidget with Functions { decoration: BoxDecoration( shape: BoxShape.circle, color: category?.color != null - ? categoryColorList[category!.color] + ? categoryColorListTheme[category!.color] : Theme.of(context).colorScheme.secondary, ), child: Padding( diff --git a/lib/pages/accounts/account_list.dart b/lib/pages/accounts/account_list.dart index c79d93a..7c44460 100644 --- a/lib/pages/accounts/account_list.dart +++ b/lib/pages/accounts/account_list.dart @@ -69,7 +69,7 @@ class _AccountListState extends ConsumerState with Functions { itemBuilder: (context, i) { BankAccount account = accounts[i]; IconData? icon = accountIconList[account.symbol]; - Color? color = accountColorList[account.color]; + Color? color = accountColorListTheme[account.color]; return DefaultContainer( onTap: () async { await ref.read(accountsProvider.notifier).selectedAccount(account).whenComplete(() => Navigator.of(context).pushNamed('/add-account')); diff --git a/lib/pages/accounts/add_account.dart b/lib/pages/accounts/add_account.dart index c554b5d..ef09b5d 100644 --- a/lib/pages/accounts/add_account.dart +++ b/lib/pages/accounts/add_account.dart @@ -117,7 +117,7 @@ class _AddAccountState extends ConsumerState with Functions { child: Ink( decoration: BoxDecoration( shape: BoxShape.circle, - color: accountColorList[accountColor], + color: accountColorListTheme[accountColor], ), padding: const EdgeInsets.all(16), child: Icon( @@ -203,16 +203,16 @@ class _AddAccountState extends ConsumerState with Functions { padding: const EdgeInsets.symmetric(horizontal: 16), separatorBuilder: (context, index) => const SizedBox(width: 16), itemBuilder: (context, index) { - Color color = accountColorList[index]; + Color color = accountColorListTheme[index]; return GestureDetector( onTap: () => ref.read(accountColorProvider.notifier).state = index, child: Container( - height: accountColorList[accountColor] == color ? 38 : 32, - width: accountColorList[accountColor] == color ? 38 : 32, + height: accountColorListTheme[accountColor] == color ? 38 : 32, + width: accountColorListTheme[accountColor] == color ? 38 : 32, decoration: BoxDecoration( shape: BoxShape.circle, color: color, - border: accountColorList[accountColor] == color + border: accountColorListTheme[accountColor] == color ? Border.all( color: Theme.of(context).colorScheme.primary, width: 3, @@ -222,7 +222,7 @@ class _AddAccountState extends ConsumerState with Functions { ), ); }, - itemCount: accountColorList.length, + itemCount: accountColorListTheme.length, ), ), const SizedBox(height: 6), diff --git a/lib/pages/add_page/widgets/account_selector.dart b/lib/pages/add_page/widgets/account_selector.dart index 4c0c9c7..e19758e 100644 --- a/lib/pages/add_page/widgets/account_selector.dart +++ b/lib/pages/add_page/widgets/account_selector.dart @@ -58,7 +58,7 @@ class _AccountSelectorState extends ConsumerState with Function itemBuilder: (context, i) { BankAccount account = accounts[i]; IconData? icon = accountIconList[account.symbol]; - Color? color = accountColorList[account.color]; + Color? color = accountColorListTheme[account.color]; return Padding( padding: const EdgeInsets.symmetric(horizontal: 16.0), child: Column( @@ -115,7 +115,7 @@ class _AccountSelectorState extends ConsumerState with Function itemBuilder: (context, i) { BankAccount account = accounts[i]; IconData? icon = accountIconList[account.symbol]; - Color? color = accountColorList[account.color]; + Color? color = accountColorListTheme[account.color]; return Material( color: Theme.of(context).colorScheme.surface, child: InkWell( diff --git a/lib/pages/add_page/widgets/category_selector.dart b/lib/pages/add_page/widgets/category_selector.dart index 024195c..77626ef 100644 --- a/lib/pages/add_page/widgets/category_selector.dart +++ b/lib/pages/add_page/widgets/category_selector.dart @@ -57,7 +57,7 @@ class _CategorySelectorState extends ConsumerState with Functi itemBuilder: (context, i) { CategoryTransaction category = categories[i]; IconData? icon = iconList[category.symbol]; - Color? color = categoryColorList[category.color]; + Color? color = categoryColorListTheme[category.color]; return Padding( padding: const EdgeInsets.symmetric(horizontal: 16.0), child: Column( @@ -114,7 +114,7 @@ class _CategorySelectorState extends ConsumerState with Functi itemBuilder: (context, i) { CategoryTransaction category = categories[i]; IconData? icon = iconList[category.symbol]; - Color? color = categoryColorList[category.color]; + Color? color = categoryColorListTheme[category.color]; return Material( color: Theme.of(context).colorScheme.surface, child: InkWell( diff --git a/lib/pages/categories/add_category.dart b/lib/pages/categories/add_category.dart index 07a3994..58957dc 100644 --- a/lib/pages/categories/add_category.dart +++ b/lib/pages/categories/add_category.dart @@ -108,7 +108,7 @@ class _AddCategoryState extends ConsumerState with Functions { child: Ink( decoration: BoxDecoration( shape: BoxShape.circle, - color: categoryColorList[categoryColor], + color: categoryColorListTheme[categoryColor], ), padding: const EdgeInsets.all(16), child: Icon( @@ -193,16 +193,16 @@ class _AddCategoryState extends ConsumerState with Functions { padding: const EdgeInsets.symmetric(horizontal: 16), separatorBuilder: (context, index) => const SizedBox(width: 16), itemBuilder: (context, index) { - Color color = categoryColorList[index]; + Color color = categoryColorListTheme[index]; return GestureDetector( onTap: () => ref.read(categoryColorProvider.notifier).state = index, child: Container( - height: categoryColorList[categoryColor] == color ? 38 : 32, - width: categoryColorList[categoryColor] == color ? 38 : 32, + height: categoryColorListTheme[categoryColor] == color ? 38 : 32, + width: categoryColorListTheme[categoryColor] == color ? 38 : 32, decoration: BoxDecoration( shape: BoxShape.circle, color: color, - border: categoryColorList[categoryColor] == color + border: categoryColorListTheme[categoryColor] == color ? Border.all( color: grey1, width: 3, @@ -212,7 +212,7 @@ class _AddCategoryState extends ConsumerState with Functions { ), ); }, - itemCount: categoryColorList.length, + itemCount: categoryColorListTheme.length, ), ), const SizedBox(height: 6), diff --git a/lib/pages/categories/category_list.dart b/lib/pages/categories/category_list.dart index 99fefdf..58e347e 100644 --- a/lib/pages/categories/category_list.dart +++ b/lib/pages/categories/category_list.dart @@ -69,7 +69,7 @@ class _CategoryListState extends ConsumerState with Functions { itemBuilder: (context, i) { CategoryTransaction category = categorys[i]; IconData? icon = iconList[category.symbol]; - Color? color = categoryColorList[category.color]; + Color? color = categoryColorListTheme[category.color]; return DefaultContainer( onTap: () async { // TODO: fix this diff --git a/lib/pages/general_options/general_settings.dart b/lib/pages/general_options/general_settings.dart index f62717f..404e697 100644 --- a/lib/pages/general_options/general_settings.dart +++ b/lib/pages/general_options/general_settings.dart @@ -115,7 +115,9 @@ class _GeneralSettingsPageState extends ConsumerState { child: Center( child: Text( NumberFormat().simpleCurrencySymbol(selectedCurrency), - style: const TextStyle(color: white, fontSize: 25), + style: TextStyle( + color: Theme.of(context).colorScheme.background, + fontSize: 25), )))), ], ), @@ -209,8 +211,11 @@ class _GeneralSettingsPageState extends ConsumerState { radius: 22, backgroundColor: blue5, child: Text(currencies.elementAt(index)[0], - style: const TextStyle( - color: Colors.white, fontSize: 20)), + style: TextStyle( + color: Theme.of(context) + .colorScheme + .background, + fontSize: 20)), ), title: Text( currencies.elementAt(index)[1], diff --git a/lib/providers/theme_provider.dart b/lib/providers/theme_provider.dart index d8dba5f..ce81e01 100644 --- a/lib/providers/theme_provider.dart +++ b/lib/providers/theme_provider.dart @@ -1,6 +1,6 @@ - import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:sossoldi/constants/constants.dart'; // import 'package:hooks_riverpod/hooks_riverpod.dart'; final appThemeStateNotifier = ChangeNotifierProvider( @@ -9,14 +9,16 @@ final appThemeStateNotifier = ChangeNotifierProvider( class AppThemeState extends ChangeNotifier { var isDarkModeEnabled = false; - - void setLightTheme(){ + + void setLightTheme() { isDarkModeEnabled = false; + updateColorsBasedOnTheme(isDarkModeEnabled); notifyListeners(); } - void setDarkTheme(){ + void setDarkTheme() { isDarkModeEnabled = true; + updateColorsBasedOnTheme(isDarkModeEnabled); notifyListeners(); } -} \ No newline at end of file +} From 534bb9d1d406cb7262cae7ab2896638a306bcb4c Mon Sep 17 00:00:00 2001 From: GioErco03 <75883612+giovanni-ercolano@users.noreply.github.com> Date: Thu, 19 Oct 2023 19:57:31 +0200 Subject: [PATCH 3/9] fix color icon settings --- lib/pages/settings_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/settings_page.dart b/lib/pages/settings_page.dart index 7328ca3..d0aa426 100644 --- a/lib/pages/settings_page.dart +++ b/lib/pages/settings_page.dart @@ -121,7 +121,7 @@ class _SettingsPageState extends ConsumerState { child: Icon( setting[0] as IconData, size: 30.0, - color: Theme.of(context).colorScheme.background, + color: white, ), ), const SizedBox(width: 12.0), From e7e999ff4001984bf6955b0193d63e3c63392c13 Mon Sep 17 00:00:00 2001 From: Giovanni Ercolano <75883612+giovanni-ercolano@users.noreply.github.com> Date: Tue, 21 Nov 2023 22:18:41 +0100 Subject: [PATCH 4/9] fix line graph, icon & dashboard color and more.. --- ios/Flutter/Debug.xcconfig | 1 + ios/Flutter/Release.xcconfig | 1 + ios/Podfile | 45 +++++++++++ ios/Runner.xcodeproj/project.pbxproj | 75 ++++++++++++++++++- .../xcshareddata/xcschemes/Runner.xcscheme | 2 +- .../contents.xcworkspacedata | 3 + lib/pages/add_page/add_page.dart | 15 ++-- lib/pages/add_page/widgets/details_tile.dart | 5 +- .../general_options/general_settings.dart | 6 +- lib/pages/home_page.dart | 12 +-- lib/pages/structure.dart | 26 ++++--- lib/providers/categories_provider.dart | 1 - lib/utils/app_theme.dart | 9 ++- macos/Flutter/Flutter-Debug.xcconfig | 1 + macos/Flutter/Flutter-Release.xcconfig | 1 + macos/Podfile | 43 +++++++++++ pubspec.lock | 58 +++++++------- 17 files changed, 245 insertions(+), 59 deletions(-) create mode 100644 ios/Podfile create mode 100644 macos/Podfile diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig index 592ceee..ec97fc6 100644 --- a/ios/Flutter/Debug.xcconfig +++ b/ios/Flutter/Debug.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig index 592ceee..c4855bf 100644 --- a/ios/Flutter/Release.xcconfig +++ b/ios/Flutter/Release.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/ios/Podfile b/ios/Podfile new file mode 100644 index 0000000..097e06a --- /dev/null +++ b/ios/Podfile @@ -0,0 +1,45 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '11.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + platform :ios, '11.0' + use_frameworks! + use_modular_headers! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) + # target 'RunnerTests' do + # inherit! :search_paths + # end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 1ef0fea..5965abf 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -13,6 +13,7 @@ 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; + 9A75436DEC7A6FF3F8A32D5C /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF22E285055C5016D393F70 /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -31,9 +32,12 @@ /* Begin PBXFileReference section */ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 1AF22E285055C5016D393F70 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 25A2235A534A95679418095F /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 79C2A9A2F3C16FFFEC9526FB /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; @@ -42,6 +46,7 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + BFC9109ABA21D364DC38C69D /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -49,12 +54,32 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 9A75436DEC7A6FF3F8A32D5C /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 6ECDD2D0F41BE58642E2DD8E /* Frameworks */ = { + isa = PBXGroup; + children = ( + 1AF22E285055C5016D393F70 /* Pods_Runner.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 831E67E00C254CB6BEB94ED5 /* Pods */ = { + isa = PBXGroup; + children = ( + 79C2A9A2F3C16FFFEC9526FB /* Pods-Runner.debug.xcconfig */, + BFC9109ABA21D364DC38C69D /* Pods-Runner.release.xcconfig */, + 25A2235A534A95679418095F /* Pods-Runner.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -72,6 +97,8 @@ 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, + 831E67E00C254CB6BEB94ED5 /* Pods */, + 6ECDD2D0F41BE58642E2DD8E /* Frameworks */, ); sourceTree = ""; }; @@ -105,12 +132,14 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( + A2892F4F5D8157B747568834 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + 7024F2D592551F05FDA378F8 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -127,7 +156,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1300; + LastUpgradeCheck = 1430; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { @@ -171,10 +200,12 @@ /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); name = "Thin Binary"; outputPaths = ( @@ -183,8 +214,26 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; + 7024F2D592551F05FDA378F8 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -197,6 +246,28 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; + A2892F4F5D8157B747568834 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index c87d15a..a6b826d 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ + + diff --git a/lib/pages/add_page/add_page.dart b/lib/pages/add_page/add_page.dart index 5d2dcf8..71e2b3b 100644 --- a/lib/pages/add_page/add_page.dart +++ b/lib/pages/add_page/add_page.dart @@ -4,8 +4,8 @@ import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import '../../utils/decimal_text_input_formatter.dart'; import '../../model/transaction.dart'; -import 'widgets/details_tile.dart'; -import 'widgets/type_tab.dart'; +import '../add_page/widgets/details_tile.dart'; +import '../add_page/widgets/type_tab.dart'; import '../../providers/transactions_provider.dart'; import '../../constants/style.dart'; import '../../constants/functions.dart'; @@ -240,9 +240,9 @@ class _AddPageState extends ConsumerState with Functions { onTap: () => ref .read(transactionsProvider.notifier) .switchAccount(), - child: Column( + child: const Column( mainAxisAlignment: MainAxisAlignment.center, - children: const [ + children: [ Expanded( child: VerticalDivider( width: 1, color: grey2)), @@ -338,7 +338,8 @@ class _AddPageState extends ConsumerState with Functions { color: typeToColor(selectedType), ), ), - keyboardType: const TextInputType.numberWithOptions(decimal: true), + keyboardType: + const TextInputType.numberWithOptions(decimal: true), inputFormatters: [ DecimalTextInputFormatter(decimalDigits: 2) ], @@ -437,7 +438,7 @@ class _AddPageState extends ConsumerState with Functions { style: Theme.of(context) .textTheme .bodySmall! - .copyWith(color: grey1), + .copyWith(color: Theme.of(context).colorScheme.onSecondary), onChanged: (value) => ref.read(noteProvider.notifier).state = value, ), @@ -660,7 +661,7 @@ class _AddPageState extends ConsumerState with Functions { ? "UPDATE TRANSACTION" : "ADD TRANSACTION", style: Theme.of(context).textTheme.bodyLarge!.copyWith( - color: Theme.of(context).colorScheme.background), + color: white), ), ), ), diff --git a/lib/pages/add_page/widgets/details_tile.dart b/lib/pages/add_page/widgets/details_tile.dart index 244b184..4de2116 100644 --- a/lib/pages/add_page/widgets/details_tile.dart +++ b/lib/pages/add_page/widgets/details_tile.dart @@ -43,7 +43,10 @@ class DetailsTile extends ConsumerWidget { children: [ Text( value ?? '', - style: Theme.of(context).textTheme.bodySmall!.copyWith(color: grey1), + style: Theme.of(context) + .textTheme + .bodySmall! + .copyWith(color: Theme.of(context).colorScheme.primary), ), const SizedBox(width: 6), const Icon(Icons.chevron_right, color: grey1), diff --git a/lib/pages/general_options/general_settings.dart b/lib/pages/general_options/general_settings.dart index 404e697..d374e7f 100644 --- a/lib/pages/general_options/general_settings.dart +++ b/lib/pages/general_options/general_settings.dart @@ -93,7 +93,7 @@ class _GeneralSettingsPageState extends ConsumerState { ? Icons.dark_mode : Icons.light_mode, size: 25.0, - color: Theme.of(context).colorScheme.background, + color: white, ), )), ], @@ -115,8 +115,8 @@ class _GeneralSettingsPageState extends ConsumerState { child: Center( child: Text( NumberFormat().simpleCurrencySymbol(selectedCurrency), - style: TextStyle( - color: Theme.of(context).colorScheme.background, + style: const TextStyle( + color: white, fontSize: 25), )))), ], diff --git a/lib/pages/home_page.dart b/lib/pages/home_page.dart index ed0c513..fe00d0f 100644 --- a/lib/pages/home_page.dart +++ b/lib/pages/home_page.dart @@ -131,8 +131,8 @@ class _HomePageState extends ConsumerState with Functions { ], ), const SizedBox(height: 16), - const LineChartWidget( - line1Data: [ + LineChartWidget( + line1Data: const [ FlSpot(0, 3), FlSpot(1, 1.3), FlSpot(2, -2), @@ -151,8 +151,8 @@ class _HomePageState extends ConsumerState with Functions { FlSpot(15, -4.5), FlSpot(16, 2.5), ], - colorLine1Data: Color(0xff00152D), - line2Data: [ + colorLine1Data: Theme.of(context).colorScheme.onSecondaryContainer, + line2Data: const [ FlSpot(0, -3), FlSpot(1, -1.3), FlSpot(2, 2), @@ -185,8 +185,8 @@ class _HomePageState extends ConsumerState with Functions { FlSpot(29, 4.7), FlSpot(30, 1), ], - colorLine2Data: Color(0xffB9BABC), //da modificare in darkMode - colorBackground: Color(0xffF1F5F9), + colorLine2Data: Colors.red, //da modificare in darkMode e capire a cosa fa riferimento + colorBackground: Theme.of(context).colorScheme.secondaryContainer, maxY: 5.0, minY: -5.0, maxDays: 31.0, diff --git a/lib/pages/structure.dart b/lib/pages/structure.dart index a773216..384d2ed 100644 --- a/lib/pages/structure.dart +++ b/lib/pages/structure.dart @@ -2,7 +2,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'add_page/add_page.dart'; +import '../constants/style.dart'; +import '../pages/add_page/add_page.dart'; import '../pages/home_page.dart'; import '../pages/transactions_page/transactions_page.dart'; import '../pages/statistics_page.dart'; @@ -48,7 +49,10 @@ class _StructureState extends ConsumerState { centerTitle: true, title: Text( _pagesTitle.elementAt(selectedIndex), - style: Theme.of(context).textTheme.headlineLarge!, + style: TextStyle( + color: Theme.of(context).colorScheme.primary, + fontSize: Theme.of(context).textTheme.headlineLarge!.fontSize, + ), ), leading: Padding( padding: const EdgeInsets.only(left: 16), @@ -58,11 +62,11 @@ class _StructureState extends ConsumerState { elevation: 0, shape: const CircleBorder(), padding: const EdgeInsets.all(8), - backgroundColor: Theme.of(context).colorScheme.primary, + backgroundColor: Theme.of(context).colorScheme.secondary, ), - child: Icon( + child: const Icon( Icons.search, - color: Theme.of(context).colorScheme.background, + color: white, ), ), ), @@ -75,11 +79,11 @@ class _StructureState extends ConsumerState { elevation: 0, shape: const CircleBorder(), padding: const EdgeInsets.all(8), - backgroundColor: Theme.of(context).colorScheme.primary, + backgroundColor: Theme.of(context).colorScheme.secondary, ), - child: Icon( + child: const Icon( Icons.settings, - color: Theme.of(context).colorScheme.background, + color: white, ), ), ), @@ -95,6 +99,7 @@ class _StructureState extends ConsumerState { selectedFontSize: 8, unselectedFontSize: 8, // backgroundColor: const Color(0xFFF6F6F6), + currentIndex: selectedIndex, onTap: (index) => index != 2 ? ref.read(selectedIndexProvider.notifier).state = index @@ -103,6 +108,7 @@ class _StructureState extends ConsumerState { BottomNavigationBarItem( icon: Icon(selectedIndex == 0 ? Icons.home : Icons.home_outlined), label: "DASHBOARD", + ), BottomNavigationBarItem( icon: Icon(selectedIndex == 1 @@ -129,10 +135,10 @@ class _StructureState extends ConsumerState { elevation: 4, highlightElevation: 0, backgroundColor: Theme.of(context).colorScheme.secondary, - child: Icon( + child: const Icon( Icons.add_rounded, size: 55, - color: Theme.of(context).colorScheme.background, + color: white, ), onPressed: () async { showModalBottomSheet( diff --git a/lib/providers/categories_provider.dart b/lib/providers/categories_provider.dart index 2cd7869..c25a1d7 100644 --- a/lib/providers/categories_provider.dart +++ b/lib/providers/categories_provider.dart @@ -1,4 +1,3 @@ -import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import '../constants/constants.dart'; import '../model/category_transaction.dart'; diff --git a/lib/utils/app_theme.dart b/lib/utils/app_theme.dart index 6d0cb21..547e64f 100644 --- a/lib/utils/app_theme.dart +++ b/lib/utils/app_theme.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; - import '../constants/style.dart'; class AppTheme { @@ -194,13 +193,15 @@ class AppTheme { ColorScheme customColorScheme = const ColorScheme( primary: blue1, primaryContainer: white, + secondaryContainer: blue7, secondary: blue5, tertiary: blue4, surface: grey3, background: white, error: red, onPrimary: white, - onSecondary: white, + onSecondary: black, + onSecondaryContainer: blue6, onSurface: blue1, onBackground: blue1, onError: black, @@ -210,13 +211,15 @@ ColorScheme customColorScheme = const ColorScheme( ColorScheme darkCustomColorScheme = const ColorScheme( primary: darkBlue1, primaryContainer: darkGrey4, + secondaryContainer: darkBlue7, secondary: darkBlue5, tertiary: darkBlack, surface: darkBlue7, //darkBlue3 background: darkWhite, error: darkRed, onPrimary: darkWhite, - onSecondary: darkWhite, + onSecondary: darkBlack, + onSecondaryContainer: darkGrey2, onSurface: darkBlue1, onBackground: darkBlue1, onError: darkBlack, diff --git a/macos/Flutter/Flutter-Debug.xcconfig b/macos/Flutter/Flutter-Debug.xcconfig index c2efd0b..4b81f9b 100644 --- a/macos/Flutter/Flutter-Debug.xcconfig +++ b/macos/Flutter/Flutter-Debug.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/macos/Flutter/Flutter-Release.xcconfig b/macos/Flutter/Flutter-Release.xcconfig index c2efd0b..5caa9d1 100644 --- a/macos/Flutter/Flutter-Release.xcconfig +++ b/macos/Flutter/Flutter-Release.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/macos/Podfile b/macos/Podfile new file mode 100644 index 0000000..c795730 --- /dev/null +++ b/macos/Podfile @@ -0,0 +1,43 @@ +platform :osx, '10.14' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_macos_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_macos_build_settings(target) + end +end diff --git a/pubspec.lock b/pubspec.lock index bceddd9..c0b6e6a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: async - sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" url: "https://pub.dev" source: hosted - version: "2.10.0" + version: "2.11.0" boolean_selector: dependency: transitive description: @@ -53,10 +53,10 @@ packages: dependency: transitive description: name: characters - sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.3.0" checked_yaml: dependency: transitive description: @@ -93,10 +93,10 @@ packages: dependency: transitive description: name: collection - sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 + sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 url: "https://pub.dev" source: hosted - version: "1.17.0" + version: "1.17.2" convert: dependency: transitive description: @@ -236,10 +236,10 @@ packages: dependency: transitive description: name: frontend_server_client - sha256: "4f4a162323c86ffc1245765cfe138872b8f069deb42f7dbb36115fa27f31469b" + sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "3.2.0" glob: dependency: transitive description: @@ -332,26 +332,26 @@ packages: dependency: transitive description: name: matcher - sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" url: "https://pub.dev" source: hosted - version: "0.12.13" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.5.0" meta: dependency: transitive description: name: meta - sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.9.1" mime: dependency: transitive description: @@ -380,10 +380,10 @@ packages: dependency: transitive description: name: path - sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.8.3" percent_indicator: dependency: "direct main" description: @@ -497,10 +497,10 @@ packages: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" sqflite: dependency: "direct main" description: @@ -593,26 +593,26 @@ packages: dependency: "direct dev" description: name: test - sha256: a5fcd2d25eeadbb6589e80198a47d6a464ba3e2049da473943b8af9797900c2d + sha256: "13b41f318e2a5751c3169137103b60c584297353d4b1761b66029bae6411fe46" url: "https://pub.dev" source: hosted - version: "1.22.0" + version: "1.24.3" test_api: dependency: transitive description: name: test_api - sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 + sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" url: "https://pub.dev" source: hosted - version: "0.4.16" + version: "0.6.0" test_core: dependency: transitive description: name: test_core - sha256: "0ef9755ec6d746951ba0aabe62f874b707690b5ede0fecc818b138fcc9b14888" + sha256: "99806e9e6d95c7b059b7a0fc08f07fc53fabe54a829497f0d9676299f1e8637e" url: "https://pub.dev" source: hosted - version: "0.4.20" + version: "0.5.3" typed_data: dependency: transitive description: @@ -717,6 +717,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.2" + web: + dependency: transitive + description: + name: web + sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + url: "https://pub.dev" + source: hosted + version: "0.1.4-beta" web_socket_channel: dependency: transitive description: @@ -750,5 +758,5 @@ packages: source: hosted version: "3.1.1" sdks: - dart: ">=2.19.0 <3.0.0" + dart: ">=3.1.0-185.0.dev <4.0.0" flutter: ">=3.7.0" From 03fbac3c5dd35462d86652926a276ebde7f166c0 Mon Sep 17 00:00:00 2001 From: Giovanni Ercolano <75883612+giovanni-ercolano@users.noreply.github.com> Date: Tue, 21 Nov 2023 22:36:25 +0100 Subject: [PATCH 5/9] Revert "fix line graph, icon & dashboard color and more.." This reverts commit e7e999ff4001984bf6955b0193d63e3c63392c13. --- ios/Flutter/Debug.xcconfig | 1 - ios/Flutter/Release.xcconfig | 1 - ios/Podfile | 45 ----------- ios/Runner.xcodeproj/project.pbxproj | 75 +------------------ .../xcshareddata/xcschemes/Runner.xcscheme | 2 +- .../contents.xcworkspacedata | 3 - lib/pages/add_page/add_page.dart | 15 ++-- lib/pages/add_page/widgets/details_tile.dart | 5 +- .../general_options/general_settings.dart | 6 +- lib/pages/home_page.dart | 12 +-- lib/pages/structure.dart | 26 +++---- lib/providers/categories_provider.dart | 1 + lib/utils/app_theme.dart | 9 +-- macos/Flutter/Flutter-Debug.xcconfig | 1 - macos/Flutter/Flutter-Release.xcconfig | 1 - macos/Podfile | 43 ----------- pubspec.lock | 58 +++++++------- 17 files changed, 59 insertions(+), 245 deletions(-) delete mode 100644 ios/Podfile delete mode 100644 macos/Podfile diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig index ec97fc6..592ceee 100644 --- a/ios/Flutter/Debug.xcconfig +++ b/ios/Flutter/Debug.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig index c4855bf..592ceee 100644 --- a/ios/Flutter/Release.xcconfig +++ b/ios/Flutter/Release.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/ios/Podfile b/ios/Podfile deleted file mode 100644 index 097e06a..0000000 --- a/ios/Podfile +++ /dev/null @@ -1,45 +0,0 @@ -# Uncomment this line to define a global platform for your project -# platform :ios, '11.0' - -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. -ENV['COCOAPODS_DISABLE_STATS'] = 'true' - -project 'Runner', { - 'Debug' => :debug, - 'Profile' => :release, - 'Release' => :release, -} - -def flutter_root - generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) - unless File.exist?(generated_xcode_build_settings_path) - raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" - end - - File.foreach(generated_xcode_build_settings_path) do |line| - matches = line.match(/FLUTTER_ROOT\=(.*)/) - return matches[1].strip if matches - end - raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" -end - -require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) - -flutter_ios_podfile_setup - -target 'Runner' do - platform :ios, '11.0' - use_frameworks! - use_modular_headers! - - flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) - # target 'RunnerTests' do - # inherit! :search_paths - # end -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - flutter_additional_ios_build_settings(target) - end -end diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 5965abf..1ef0fea 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 54; + objectVersion = 50; objects = { /* Begin PBXBuildFile section */ @@ -13,7 +13,6 @@ 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - 9A75436DEC7A6FF3F8A32D5C /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF22E285055C5016D393F70 /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -32,12 +31,9 @@ /* Begin PBXFileReference section */ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 1AF22E285055C5016D393F70 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 25A2235A534A95679418095F /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 79C2A9A2F3C16FFFEC9526FB /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; @@ -46,7 +42,6 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - BFC9109ABA21D364DC38C69D /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -54,32 +49,12 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 9A75436DEC7A6FF3F8A32D5C /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 6ECDD2D0F41BE58642E2DD8E /* Frameworks */ = { - isa = PBXGroup; - children = ( - 1AF22E285055C5016D393F70 /* Pods_Runner.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 831E67E00C254CB6BEB94ED5 /* Pods */ = { - isa = PBXGroup; - children = ( - 79C2A9A2F3C16FFFEC9526FB /* Pods-Runner.debug.xcconfig */, - BFC9109ABA21D364DC38C69D /* Pods-Runner.release.xcconfig */, - 25A2235A534A95679418095F /* Pods-Runner.profile.xcconfig */, - ); - name = Pods; - path = Pods; - sourceTree = ""; - }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -97,8 +72,6 @@ 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, - 831E67E00C254CB6BEB94ED5 /* Pods */, - 6ECDD2D0F41BE58642E2DD8E /* Frameworks */, ); sourceTree = ""; }; @@ -132,14 +105,12 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - A2892F4F5D8157B747568834 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 7024F2D592551F05FDA378F8 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -156,7 +127,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1430; + LastUpgradeCheck = 1300; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { @@ -200,12 +171,10 @@ /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( - "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); name = "Thin Binary"; outputPaths = ( @@ -214,26 +183,8 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; - 7024F2D592551F05FDA378F8 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -246,28 +197,6 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; - A2892F4F5D8157B747568834 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index a6b826d..c87d15a 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ - - diff --git a/lib/pages/add_page/add_page.dart b/lib/pages/add_page/add_page.dart index 71e2b3b..5d2dcf8 100644 --- a/lib/pages/add_page/add_page.dart +++ b/lib/pages/add_page/add_page.dart @@ -4,8 +4,8 @@ import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import '../../utils/decimal_text_input_formatter.dart'; import '../../model/transaction.dart'; -import '../add_page/widgets/details_tile.dart'; -import '../add_page/widgets/type_tab.dart'; +import 'widgets/details_tile.dart'; +import 'widgets/type_tab.dart'; import '../../providers/transactions_provider.dart'; import '../../constants/style.dart'; import '../../constants/functions.dart'; @@ -240,9 +240,9 @@ class _AddPageState extends ConsumerState with Functions { onTap: () => ref .read(transactionsProvider.notifier) .switchAccount(), - child: const Column( + child: Column( mainAxisAlignment: MainAxisAlignment.center, - children: [ + children: const [ Expanded( child: VerticalDivider( width: 1, color: grey2)), @@ -338,8 +338,7 @@ class _AddPageState extends ConsumerState with Functions { color: typeToColor(selectedType), ), ), - keyboardType: - const TextInputType.numberWithOptions(decimal: true), + keyboardType: const TextInputType.numberWithOptions(decimal: true), inputFormatters: [ DecimalTextInputFormatter(decimalDigits: 2) ], @@ -438,7 +437,7 @@ class _AddPageState extends ConsumerState with Functions { style: Theme.of(context) .textTheme .bodySmall! - .copyWith(color: Theme.of(context).colorScheme.onSecondary), + .copyWith(color: grey1), onChanged: (value) => ref.read(noteProvider.notifier).state = value, ), @@ -661,7 +660,7 @@ class _AddPageState extends ConsumerState with Functions { ? "UPDATE TRANSACTION" : "ADD TRANSACTION", style: Theme.of(context).textTheme.bodyLarge!.copyWith( - color: white), + color: Theme.of(context).colorScheme.background), ), ), ), diff --git a/lib/pages/add_page/widgets/details_tile.dart b/lib/pages/add_page/widgets/details_tile.dart index 4de2116..244b184 100644 --- a/lib/pages/add_page/widgets/details_tile.dart +++ b/lib/pages/add_page/widgets/details_tile.dart @@ -43,10 +43,7 @@ class DetailsTile extends ConsumerWidget { children: [ Text( value ?? '', - style: Theme.of(context) - .textTheme - .bodySmall! - .copyWith(color: Theme.of(context).colorScheme.primary), + style: Theme.of(context).textTheme.bodySmall!.copyWith(color: grey1), ), const SizedBox(width: 6), const Icon(Icons.chevron_right, color: grey1), diff --git a/lib/pages/general_options/general_settings.dart b/lib/pages/general_options/general_settings.dart index d374e7f..404e697 100644 --- a/lib/pages/general_options/general_settings.dart +++ b/lib/pages/general_options/general_settings.dart @@ -93,7 +93,7 @@ class _GeneralSettingsPageState extends ConsumerState { ? Icons.dark_mode : Icons.light_mode, size: 25.0, - color: white, + color: Theme.of(context).colorScheme.background, ), )), ], @@ -115,8 +115,8 @@ class _GeneralSettingsPageState extends ConsumerState { child: Center( child: Text( NumberFormat().simpleCurrencySymbol(selectedCurrency), - style: const TextStyle( - color: white, + style: TextStyle( + color: Theme.of(context).colorScheme.background, fontSize: 25), )))), ], diff --git a/lib/pages/home_page.dart b/lib/pages/home_page.dart index fe00d0f..ed0c513 100644 --- a/lib/pages/home_page.dart +++ b/lib/pages/home_page.dart @@ -131,8 +131,8 @@ class _HomePageState extends ConsumerState with Functions { ], ), const SizedBox(height: 16), - LineChartWidget( - line1Data: const [ + const LineChartWidget( + line1Data: [ FlSpot(0, 3), FlSpot(1, 1.3), FlSpot(2, -2), @@ -151,8 +151,8 @@ class _HomePageState extends ConsumerState with Functions { FlSpot(15, -4.5), FlSpot(16, 2.5), ], - colorLine1Data: Theme.of(context).colorScheme.onSecondaryContainer, - line2Data: const [ + colorLine1Data: Color(0xff00152D), + line2Data: [ FlSpot(0, -3), FlSpot(1, -1.3), FlSpot(2, 2), @@ -185,8 +185,8 @@ class _HomePageState extends ConsumerState with Functions { FlSpot(29, 4.7), FlSpot(30, 1), ], - colorLine2Data: Colors.red, //da modificare in darkMode e capire a cosa fa riferimento - colorBackground: Theme.of(context).colorScheme.secondaryContainer, + colorLine2Data: Color(0xffB9BABC), //da modificare in darkMode + colorBackground: Color(0xffF1F5F9), maxY: 5.0, minY: -5.0, maxDays: 31.0, diff --git a/lib/pages/structure.dart b/lib/pages/structure.dart index 384d2ed..a773216 100644 --- a/lib/pages/structure.dart +++ b/lib/pages/structure.dart @@ -2,8 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import '../constants/style.dart'; -import '../pages/add_page/add_page.dart'; +import 'add_page/add_page.dart'; import '../pages/home_page.dart'; import '../pages/transactions_page/transactions_page.dart'; import '../pages/statistics_page.dart'; @@ -49,10 +48,7 @@ class _StructureState extends ConsumerState { centerTitle: true, title: Text( _pagesTitle.elementAt(selectedIndex), - style: TextStyle( - color: Theme.of(context).colorScheme.primary, - fontSize: Theme.of(context).textTheme.headlineLarge!.fontSize, - ), + style: Theme.of(context).textTheme.headlineLarge!, ), leading: Padding( padding: const EdgeInsets.only(left: 16), @@ -62,11 +58,11 @@ class _StructureState extends ConsumerState { elevation: 0, shape: const CircleBorder(), padding: const EdgeInsets.all(8), - backgroundColor: Theme.of(context).colorScheme.secondary, + backgroundColor: Theme.of(context).colorScheme.primary, ), - child: const Icon( + child: Icon( Icons.search, - color: white, + color: Theme.of(context).colorScheme.background, ), ), ), @@ -79,11 +75,11 @@ class _StructureState extends ConsumerState { elevation: 0, shape: const CircleBorder(), padding: const EdgeInsets.all(8), - backgroundColor: Theme.of(context).colorScheme.secondary, + backgroundColor: Theme.of(context).colorScheme.primary, ), - child: const Icon( + child: Icon( Icons.settings, - color: white, + color: Theme.of(context).colorScheme.background, ), ), ), @@ -99,7 +95,6 @@ class _StructureState extends ConsumerState { selectedFontSize: 8, unselectedFontSize: 8, // backgroundColor: const Color(0xFFF6F6F6), - currentIndex: selectedIndex, onTap: (index) => index != 2 ? ref.read(selectedIndexProvider.notifier).state = index @@ -108,7 +103,6 @@ class _StructureState extends ConsumerState { BottomNavigationBarItem( icon: Icon(selectedIndex == 0 ? Icons.home : Icons.home_outlined), label: "DASHBOARD", - ), BottomNavigationBarItem( icon: Icon(selectedIndex == 1 @@ -135,10 +129,10 @@ class _StructureState extends ConsumerState { elevation: 4, highlightElevation: 0, backgroundColor: Theme.of(context).colorScheme.secondary, - child: const Icon( + child: Icon( Icons.add_rounded, size: 55, - color: white, + color: Theme.of(context).colorScheme.background, ), onPressed: () async { showModalBottomSheet( diff --git a/lib/providers/categories_provider.dart b/lib/providers/categories_provider.dart index c25a1d7..2cd7869 100644 --- a/lib/providers/categories_provider.dart +++ b/lib/providers/categories_provider.dart @@ -1,3 +1,4 @@ +import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import '../constants/constants.dart'; import '../model/category_transaction.dart'; diff --git a/lib/utils/app_theme.dart b/lib/utils/app_theme.dart index 547e64f..6d0cb21 100644 --- a/lib/utils/app_theme.dart +++ b/lib/utils/app_theme.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; + import '../constants/style.dart'; class AppTheme { @@ -193,15 +194,13 @@ class AppTheme { ColorScheme customColorScheme = const ColorScheme( primary: blue1, primaryContainer: white, - secondaryContainer: blue7, secondary: blue5, tertiary: blue4, surface: grey3, background: white, error: red, onPrimary: white, - onSecondary: black, - onSecondaryContainer: blue6, + onSecondary: white, onSurface: blue1, onBackground: blue1, onError: black, @@ -211,15 +210,13 @@ ColorScheme customColorScheme = const ColorScheme( ColorScheme darkCustomColorScheme = const ColorScheme( primary: darkBlue1, primaryContainer: darkGrey4, - secondaryContainer: darkBlue7, secondary: darkBlue5, tertiary: darkBlack, surface: darkBlue7, //darkBlue3 background: darkWhite, error: darkRed, onPrimary: darkWhite, - onSecondary: darkBlack, - onSecondaryContainer: darkGrey2, + onSecondary: darkWhite, onSurface: darkBlue1, onBackground: darkBlue1, onError: darkBlack, diff --git a/macos/Flutter/Flutter-Debug.xcconfig b/macos/Flutter/Flutter-Debug.xcconfig index 4b81f9b..c2efd0b 100644 --- a/macos/Flutter/Flutter-Debug.xcconfig +++ b/macos/Flutter/Flutter-Debug.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/macos/Flutter/Flutter-Release.xcconfig b/macos/Flutter/Flutter-Release.xcconfig index 5caa9d1..c2efd0b 100644 --- a/macos/Flutter/Flutter-Release.xcconfig +++ b/macos/Flutter/Flutter-Release.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/macos/Podfile b/macos/Podfile deleted file mode 100644 index c795730..0000000 --- a/macos/Podfile +++ /dev/null @@ -1,43 +0,0 @@ -platform :osx, '10.14' - -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. -ENV['COCOAPODS_DISABLE_STATS'] = 'true' - -project 'Runner', { - 'Debug' => :debug, - 'Profile' => :release, - 'Release' => :release, -} - -def flutter_root - generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) - unless File.exist?(generated_xcode_build_settings_path) - raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" - end - - File.foreach(generated_xcode_build_settings_path) do |line| - matches = line.match(/FLUTTER_ROOT\=(.*)/) - return matches[1].strip if matches - end - raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" -end - -require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) - -flutter_macos_podfile_setup - -target 'Runner' do - use_frameworks! - use_modular_headers! - - flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) - target 'RunnerTests' do - inherit! :search_paths - end -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - flutter_additional_macos_build_settings(target) - end -end diff --git a/pubspec.lock b/pubspec.lock index c0b6e6a..bceddd9 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: async - sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 url: "https://pub.dev" source: hosted - version: "2.11.0" + version: "2.10.0" boolean_selector: dependency: transitive description: @@ -53,10 +53,10 @@ packages: dependency: transitive description: name: characters - sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.2.1" checked_yaml: dependency: transitive description: @@ -93,10 +93,10 @@ packages: dependency: transitive description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.17.0" convert: dependency: transitive description: @@ -236,10 +236,10 @@ packages: dependency: transitive description: name: frontend_server_client - sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" + sha256: "4f4a162323c86ffc1245765cfe138872b8f069deb42f7dbb36115fa27f31469b" url: "https://pub.dev" source: hosted - version: "3.2.0" + version: "2.1.3" glob: dependency: transitive description: @@ -332,26 +332,26 @@ packages: dependency: transitive description: name: matcher - sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" url: "https://pub.dev" source: hosted - version: "0.12.16" + version: "0.12.13" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.2.0" meta: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.8.0" mime: dependency: transitive description: @@ -380,10 +380,10 @@ packages: dependency: transitive description: name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b url: "https://pub.dev" source: hosted - version: "1.8.3" + version: "1.8.2" percent_indicator: dependency: "direct main" description: @@ -497,10 +497,10 @@ packages: dependency: transitive description: name: source_span - sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.9.1" sqflite: dependency: "direct main" description: @@ -593,26 +593,26 @@ packages: dependency: "direct dev" description: name: test - sha256: "13b41f318e2a5751c3169137103b60c584297353d4b1761b66029bae6411fe46" + sha256: a5fcd2d25eeadbb6589e80198a47d6a464ba3e2049da473943b8af9797900c2d url: "https://pub.dev" source: hosted - version: "1.24.3" + version: "1.22.0" test_api: dependency: transitive description: name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.4.16" test_core: dependency: transitive description: name: test_core - sha256: "99806e9e6d95c7b059b7a0fc08f07fc53fabe54a829497f0d9676299f1e8637e" + sha256: "0ef9755ec6d746951ba0aabe62f874b707690b5ede0fecc818b138fcc9b14888" url: "https://pub.dev" source: hosted - version: "0.5.3" + version: "0.4.20" typed_data: dependency: transitive description: @@ -717,14 +717,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.2" - web: - dependency: transitive - description: - name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 - url: "https://pub.dev" - source: hosted - version: "0.1.4-beta" web_socket_channel: dependency: transitive description: @@ -758,5 +750,5 @@ packages: source: hosted version: "3.1.1" sdks: - dart: ">=3.1.0-185.0.dev <4.0.0" + dart: ">=2.19.0 <3.0.0" flutter: ">=3.7.0" From c8122ce2d26f993b8d37e8003131964e469118ec Mon Sep 17 00:00:00 2001 From: Giovanni Ercolano <75883612+giovanni-ercolano@users.noreply.github.com> Date: Tue, 21 Nov 2023 22:36:57 +0100 Subject: [PATCH 6/9] Revert "Revert "fix line graph, icon & dashboard color and more.."" This reverts commit 03fbac3c5dd35462d86652926a276ebde7f166c0. --- ios/Flutter/Debug.xcconfig | 1 + ios/Flutter/Release.xcconfig | 1 + ios/Podfile | 45 +++++++++++ ios/Runner.xcodeproj/project.pbxproj | 75 ++++++++++++++++++- .../xcshareddata/xcschemes/Runner.xcscheme | 2 +- .../contents.xcworkspacedata | 3 + lib/pages/add_page/add_page.dart | 15 ++-- lib/pages/add_page/widgets/details_tile.dart | 5 +- .../general_options/general_settings.dart | 6 +- lib/pages/home_page.dart | 12 +-- lib/pages/structure.dart | 26 ++++--- lib/providers/categories_provider.dart | 1 - lib/utils/app_theme.dart | 9 ++- macos/Flutter/Flutter-Debug.xcconfig | 1 + macos/Flutter/Flutter-Release.xcconfig | 1 + macos/Podfile | 43 +++++++++++ pubspec.lock | 58 +++++++------- 17 files changed, 245 insertions(+), 59 deletions(-) create mode 100644 ios/Podfile create mode 100644 macos/Podfile diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig index 592ceee..ec97fc6 100644 --- a/ios/Flutter/Debug.xcconfig +++ b/ios/Flutter/Debug.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig index 592ceee..c4855bf 100644 --- a/ios/Flutter/Release.xcconfig +++ b/ios/Flutter/Release.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/ios/Podfile b/ios/Podfile new file mode 100644 index 0000000..097e06a --- /dev/null +++ b/ios/Podfile @@ -0,0 +1,45 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '11.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + platform :ios, '11.0' + use_frameworks! + use_modular_headers! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) + # target 'RunnerTests' do + # inherit! :search_paths + # end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 1ef0fea..5965abf 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -13,6 +13,7 @@ 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; + 9A75436DEC7A6FF3F8A32D5C /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF22E285055C5016D393F70 /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -31,9 +32,12 @@ /* Begin PBXFileReference section */ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 1AF22E285055C5016D393F70 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 25A2235A534A95679418095F /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 79C2A9A2F3C16FFFEC9526FB /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; @@ -42,6 +46,7 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + BFC9109ABA21D364DC38C69D /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -49,12 +54,32 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 9A75436DEC7A6FF3F8A32D5C /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 6ECDD2D0F41BE58642E2DD8E /* Frameworks */ = { + isa = PBXGroup; + children = ( + 1AF22E285055C5016D393F70 /* Pods_Runner.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 831E67E00C254CB6BEB94ED5 /* Pods */ = { + isa = PBXGroup; + children = ( + 79C2A9A2F3C16FFFEC9526FB /* Pods-Runner.debug.xcconfig */, + BFC9109ABA21D364DC38C69D /* Pods-Runner.release.xcconfig */, + 25A2235A534A95679418095F /* Pods-Runner.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -72,6 +97,8 @@ 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, + 831E67E00C254CB6BEB94ED5 /* Pods */, + 6ECDD2D0F41BE58642E2DD8E /* Frameworks */, ); sourceTree = ""; }; @@ -105,12 +132,14 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( + A2892F4F5D8157B747568834 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + 7024F2D592551F05FDA378F8 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -127,7 +156,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1300; + LastUpgradeCheck = 1430; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { @@ -171,10 +200,12 @@ /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); name = "Thin Binary"; outputPaths = ( @@ -183,8 +214,26 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; + 7024F2D592551F05FDA378F8 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -197,6 +246,28 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; + A2892F4F5D8157B747568834 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index c87d15a..a6b826d 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ + + diff --git a/lib/pages/add_page/add_page.dart b/lib/pages/add_page/add_page.dart index 5d2dcf8..71e2b3b 100644 --- a/lib/pages/add_page/add_page.dart +++ b/lib/pages/add_page/add_page.dart @@ -4,8 +4,8 @@ import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import '../../utils/decimal_text_input_formatter.dart'; import '../../model/transaction.dart'; -import 'widgets/details_tile.dart'; -import 'widgets/type_tab.dart'; +import '../add_page/widgets/details_tile.dart'; +import '../add_page/widgets/type_tab.dart'; import '../../providers/transactions_provider.dart'; import '../../constants/style.dart'; import '../../constants/functions.dart'; @@ -240,9 +240,9 @@ class _AddPageState extends ConsumerState with Functions { onTap: () => ref .read(transactionsProvider.notifier) .switchAccount(), - child: Column( + child: const Column( mainAxisAlignment: MainAxisAlignment.center, - children: const [ + children: [ Expanded( child: VerticalDivider( width: 1, color: grey2)), @@ -338,7 +338,8 @@ class _AddPageState extends ConsumerState with Functions { color: typeToColor(selectedType), ), ), - keyboardType: const TextInputType.numberWithOptions(decimal: true), + keyboardType: + const TextInputType.numberWithOptions(decimal: true), inputFormatters: [ DecimalTextInputFormatter(decimalDigits: 2) ], @@ -437,7 +438,7 @@ class _AddPageState extends ConsumerState with Functions { style: Theme.of(context) .textTheme .bodySmall! - .copyWith(color: grey1), + .copyWith(color: Theme.of(context).colorScheme.onSecondary), onChanged: (value) => ref.read(noteProvider.notifier).state = value, ), @@ -660,7 +661,7 @@ class _AddPageState extends ConsumerState with Functions { ? "UPDATE TRANSACTION" : "ADD TRANSACTION", style: Theme.of(context).textTheme.bodyLarge!.copyWith( - color: Theme.of(context).colorScheme.background), + color: white), ), ), ), diff --git a/lib/pages/add_page/widgets/details_tile.dart b/lib/pages/add_page/widgets/details_tile.dart index 244b184..4de2116 100644 --- a/lib/pages/add_page/widgets/details_tile.dart +++ b/lib/pages/add_page/widgets/details_tile.dart @@ -43,7 +43,10 @@ class DetailsTile extends ConsumerWidget { children: [ Text( value ?? '', - style: Theme.of(context).textTheme.bodySmall!.copyWith(color: grey1), + style: Theme.of(context) + .textTheme + .bodySmall! + .copyWith(color: Theme.of(context).colorScheme.primary), ), const SizedBox(width: 6), const Icon(Icons.chevron_right, color: grey1), diff --git a/lib/pages/general_options/general_settings.dart b/lib/pages/general_options/general_settings.dart index 404e697..d374e7f 100644 --- a/lib/pages/general_options/general_settings.dart +++ b/lib/pages/general_options/general_settings.dart @@ -93,7 +93,7 @@ class _GeneralSettingsPageState extends ConsumerState { ? Icons.dark_mode : Icons.light_mode, size: 25.0, - color: Theme.of(context).colorScheme.background, + color: white, ), )), ], @@ -115,8 +115,8 @@ class _GeneralSettingsPageState extends ConsumerState { child: Center( child: Text( NumberFormat().simpleCurrencySymbol(selectedCurrency), - style: TextStyle( - color: Theme.of(context).colorScheme.background, + style: const TextStyle( + color: white, fontSize: 25), )))), ], diff --git a/lib/pages/home_page.dart b/lib/pages/home_page.dart index ed0c513..fe00d0f 100644 --- a/lib/pages/home_page.dart +++ b/lib/pages/home_page.dart @@ -131,8 +131,8 @@ class _HomePageState extends ConsumerState with Functions { ], ), const SizedBox(height: 16), - const LineChartWidget( - line1Data: [ + LineChartWidget( + line1Data: const [ FlSpot(0, 3), FlSpot(1, 1.3), FlSpot(2, -2), @@ -151,8 +151,8 @@ class _HomePageState extends ConsumerState with Functions { FlSpot(15, -4.5), FlSpot(16, 2.5), ], - colorLine1Data: Color(0xff00152D), - line2Data: [ + colorLine1Data: Theme.of(context).colorScheme.onSecondaryContainer, + line2Data: const [ FlSpot(0, -3), FlSpot(1, -1.3), FlSpot(2, 2), @@ -185,8 +185,8 @@ class _HomePageState extends ConsumerState with Functions { FlSpot(29, 4.7), FlSpot(30, 1), ], - colorLine2Data: Color(0xffB9BABC), //da modificare in darkMode - colorBackground: Color(0xffF1F5F9), + colorLine2Data: Colors.red, //da modificare in darkMode e capire a cosa fa riferimento + colorBackground: Theme.of(context).colorScheme.secondaryContainer, maxY: 5.0, minY: -5.0, maxDays: 31.0, diff --git a/lib/pages/structure.dart b/lib/pages/structure.dart index a773216..384d2ed 100644 --- a/lib/pages/structure.dart +++ b/lib/pages/structure.dart @@ -2,7 +2,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'add_page/add_page.dart'; +import '../constants/style.dart'; +import '../pages/add_page/add_page.dart'; import '../pages/home_page.dart'; import '../pages/transactions_page/transactions_page.dart'; import '../pages/statistics_page.dart'; @@ -48,7 +49,10 @@ class _StructureState extends ConsumerState { centerTitle: true, title: Text( _pagesTitle.elementAt(selectedIndex), - style: Theme.of(context).textTheme.headlineLarge!, + style: TextStyle( + color: Theme.of(context).colorScheme.primary, + fontSize: Theme.of(context).textTheme.headlineLarge!.fontSize, + ), ), leading: Padding( padding: const EdgeInsets.only(left: 16), @@ -58,11 +62,11 @@ class _StructureState extends ConsumerState { elevation: 0, shape: const CircleBorder(), padding: const EdgeInsets.all(8), - backgroundColor: Theme.of(context).colorScheme.primary, + backgroundColor: Theme.of(context).colorScheme.secondary, ), - child: Icon( + child: const Icon( Icons.search, - color: Theme.of(context).colorScheme.background, + color: white, ), ), ), @@ -75,11 +79,11 @@ class _StructureState extends ConsumerState { elevation: 0, shape: const CircleBorder(), padding: const EdgeInsets.all(8), - backgroundColor: Theme.of(context).colorScheme.primary, + backgroundColor: Theme.of(context).colorScheme.secondary, ), - child: Icon( + child: const Icon( Icons.settings, - color: Theme.of(context).colorScheme.background, + color: white, ), ), ), @@ -95,6 +99,7 @@ class _StructureState extends ConsumerState { selectedFontSize: 8, unselectedFontSize: 8, // backgroundColor: const Color(0xFFF6F6F6), + currentIndex: selectedIndex, onTap: (index) => index != 2 ? ref.read(selectedIndexProvider.notifier).state = index @@ -103,6 +108,7 @@ class _StructureState extends ConsumerState { BottomNavigationBarItem( icon: Icon(selectedIndex == 0 ? Icons.home : Icons.home_outlined), label: "DASHBOARD", + ), BottomNavigationBarItem( icon: Icon(selectedIndex == 1 @@ -129,10 +135,10 @@ class _StructureState extends ConsumerState { elevation: 4, highlightElevation: 0, backgroundColor: Theme.of(context).colorScheme.secondary, - child: Icon( + child: const Icon( Icons.add_rounded, size: 55, - color: Theme.of(context).colorScheme.background, + color: white, ), onPressed: () async { showModalBottomSheet( diff --git a/lib/providers/categories_provider.dart b/lib/providers/categories_provider.dart index 2cd7869..c25a1d7 100644 --- a/lib/providers/categories_provider.dart +++ b/lib/providers/categories_provider.dart @@ -1,4 +1,3 @@ -import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import '../constants/constants.dart'; import '../model/category_transaction.dart'; diff --git a/lib/utils/app_theme.dart b/lib/utils/app_theme.dart index 6d0cb21..547e64f 100644 --- a/lib/utils/app_theme.dart +++ b/lib/utils/app_theme.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; - import '../constants/style.dart'; class AppTheme { @@ -194,13 +193,15 @@ class AppTheme { ColorScheme customColorScheme = const ColorScheme( primary: blue1, primaryContainer: white, + secondaryContainer: blue7, secondary: blue5, tertiary: blue4, surface: grey3, background: white, error: red, onPrimary: white, - onSecondary: white, + onSecondary: black, + onSecondaryContainer: blue6, onSurface: blue1, onBackground: blue1, onError: black, @@ -210,13 +211,15 @@ ColorScheme customColorScheme = const ColorScheme( ColorScheme darkCustomColorScheme = const ColorScheme( primary: darkBlue1, primaryContainer: darkGrey4, + secondaryContainer: darkBlue7, secondary: darkBlue5, tertiary: darkBlack, surface: darkBlue7, //darkBlue3 background: darkWhite, error: darkRed, onPrimary: darkWhite, - onSecondary: darkWhite, + onSecondary: darkBlack, + onSecondaryContainer: darkGrey2, onSurface: darkBlue1, onBackground: darkBlue1, onError: darkBlack, diff --git a/macos/Flutter/Flutter-Debug.xcconfig b/macos/Flutter/Flutter-Debug.xcconfig index c2efd0b..4b81f9b 100644 --- a/macos/Flutter/Flutter-Debug.xcconfig +++ b/macos/Flutter/Flutter-Debug.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/macos/Flutter/Flutter-Release.xcconfig b/macos/Flutter/Flutter-Release.xcconfig index c2efd0b..5caa9d1 100644 --- a/macos/Flutter/Flutter-Release.xcconfig +++ b/macos/Flutter/Flutter-Release.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/macos/Podfile b/macos/Podfile new file mode 100644 index 0000000..c795730 --- /dev/null +++ b/macos/Podfile @@ -0,0 +1,43 @@ +platform :osx, '10.14' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_macos_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_macos_build_settings(target) + end +end diff --git a/pubspec.lock b/pubspec.lock index bceddd9..c0b6e6a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: async - sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" url: "https://pub.dev" source: hosted - version: "2.10.0" + version: "2.11.0" boolean_selector: dependency: transitive description: @@ -53,10 +53,10 @@ packages: dependency: transitive description: name: characters - sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.3.0" checked_yaml: dependency: transitive description: @@ -93,10 +93,10 @@ packages: dependency: transitive description: name: collection - sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 + sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 url: "https://pub.dev" source: hosted - version: "1.17.0" + version: "1.17.2" convert: dependency: transitive description: @@ -236,10 +236,10 @@ packages: dependency: transitive description: name: frontend_server_client - sha256: "4f4a162323c86ffc1245765cfe138872b8f069deb42f7dbb36115fa27f31469b" + sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "3.2.0" glob: dependency: transitive description: @@ -332,26 +332,26 @@ packages: dependency: transitive description: name: matcher - sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" url: "https://pub.dev" source: hosted - version: "0.12.13" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.5.0" meta: dependency: transitive description: name: meta - sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.9.1" mime: dependency: transitive description: @@ -380,10 +380,10 @@ packages: dependency: transitive description: name: path - sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.8.3" percent_indicator: dependency: "direct main" description: @@ -497,10 +497,10 @@ packages: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" sqflite: dependency: "direct main" description: @@ -593,26 +593,26 @@ packages: dependency: "direct dev" description: name: test - sha256: a5fcd2d25eeadbb6589e80198a47d6a464ba3e2049da473943b8af9797900c2d + sha256: "13b41f318e2a5751c3169137103b60c584297353d4b1761b66029bae6411fe46" url: "https://pub.dev" source: hosted - version: "1.22.0" + version: "1.24.3" test_api: dependency: transitive description: name: test_api - sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 + sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" url: "https://pub.dev" source: hosted - version: "0.4.16" + version: "0.6.0" test_core: dependency: transitive description: name: test_core - sha256: "0ef9755ec6d746951ba0aabe62f874b707690b5ede0fecc818b138fcc9b14888" + sha256: "99806e9e6d95c7b059b7a0fc08f07fc53fabe54a829497f0d9676299f1e8637e" url: "https://pub.dev" source: hosted - version: "0.4.20" + version: "0.5.3" typed_data: dependency: transitive description: @@ -717,6 +717,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.2" + web: + dependency: transitive + description: + name: web + sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + url: "https://pub.dev" + source: hosted + version: "0.1.4-beta" web_socket_channel: dependency: transitive description: @@ -750,5 +758,5 @@ packages: source: hosted version: "3.1.1" sdks: - dart: ">=2.19.0 <3.0.0" + dart: ">=3.1.0-185.0.dev <4.0.0" flutter: ">=3.7.0" From ee0a787cee75ec5662ee6ee3481302194b83e981 Mon Sep 17 00:00:00 2001 From: Giovanni Ercolano <75883612+giovanni-ercolano@users.noreply.github.com> Date: Sat, 25 Nov 2023 14:49:04 +0100 Subject: [PATCH 7/9] fix line graph, icon & dashboard color and more.. only lib folder --- lib/pages/add_page/add_page.dart | 15 +++++------ lib/pages/add_page/widgets/details_tile.dart | 5 +--- .../general_options/general_settings.dart | 6 ++--- lib/pages/home_page.dart | 12 ++++----- lib/pages/structure.dart | 26 +++++++------------ lib/providers/categories_provider.dart | 1 + lib/utils/app_theme.dart | 9 +++---- 7 files changed, 31 insertions(+), 43 deletions(-) diff --git a/lib/pages/add_page/add_page.dart b/lib/pages/add_page/add_page.dart index 71e2b3b..5d2dcf8 100644 --- a/lib/pages/add_page/add_page.dart +++ b/lib/pages/add_page/add_page.dart @@ -4,8 +4,8 @@ import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import '../../utils/decimal_text_input_formatter.dart'; import '../../model/transaction.dart'; -import '../add_page/widgets/details_tile.dart'; -import '../add_page/widgets/type_tab.dart'; +import 'widgets/details_tile.dart'; +import 'widgets/type_tab.dart'; import '../../providers/transactions_provider.dart'; import '../../constants/style.dart'; import '../../constants/functions.dart'; @@ -240,9 +240,9 @@ class _AddPageState extends ConsumerState with Functions { onTap: () => ref .read(transactionsProvider.notifier) .switchAccount(), - child: const Column( + child: Column( mainAxisAlignment: MainAxisAlignment.center, - children: [ + children: const [ Expanded( child: VerticalDivider( width: 1, color: grey2)), @@ -338,8 +338,7 @@ class _AddPageState extends ConsumerState with Functions { color: typeToColor(selectedType), ), ), - keyboardType: - const TextInputType.numberWithOptions(decimal: true), + keyboardType: const TextInputType.numberWithOptions(decimal: true), inputFormatters: [ DecimalTextInputFormatter(decimalDigits: 2) ], @@ -438,7 +437,7 @@ class _AddPageState extends ConsumerState with Functions { style: Theme.of(context) .textTheme .bodySmall! - .copyWith(color: Theme.of(context).colorScheme.onSecondary), + .copyWith(color: grey1), onChanged: (value) => ref.read(noteProvider.notifier).state = value, ), @@ -661,7 +660,7 @@ class _AddPageState extends ConsumerState with Functions { ? "UPDATE TRANSACTION" : "ADD TRANSACTION", style: Theme.of(context).textTheme.bodyLarge!.copyWith( - color: white), + color: Theme.of(context).colorScheme.background), ), ), ), diff --git a/lib/pages/add_page/widgets/details_tile.dart b/lib/pages/add_page/widgets/details_tile.dart index 4de2116..244b184 100644 --- a/lib/pages/add_page/widgets/details_tile.dart +++ b/lib/pages/add_page/widgets/details_tile.dart @@ -43,10 +43,7 @@ class DetailsTile extends ConsumerWidget { children: [ Text( value ?? '', - style: Theme.of(context) - .textTheme - .bodySmall! - .copyWith(color: Theme.of(context).colorScheme.primary), + style: Theme.of(context).textTheme.bodySmall!.copyWith(color: grey1), ), const SizedBox(width: 6), const Icon(Icons.chevron_right, color: grey1), diff --git a/lib/pages/general_options/general_settings.dart b/lib/pages/general_options/general_settings.dart index d374e7f..404e697 100644 --- a/lib/pages/general_options/general_settings.dart +++ b/lib/pages/general_options/general_settings.dart @@ -93,7 +93,7 @@ class _GeneralSettingsPageState extends ConsumerState { ? Icons.dark_mode : Icons.light_mode, size: 25.0, - color: white, + color: Theme.of(context).colorScheme.background, ), )), ], @@ -115,8 +115,8 @@ class _GeneralSettingsPageState extends ConsumerState { child: Center( child: Text( NumberFormat().simpleCurrencySymbol(selectedCurrency), - style: const TextStyle( - color: white, + style: TextStyle( + color: Theme.of(context).colorScheme.background, fontSize: 25), )))), ], diff --git a/lib/pages/home_page.dart b/lib/pages/home_page.dart index fe00d0f..ed0c513 100644 --- a/lib/pages/home_page.dart +++ b/lib/pages/home_page.dart @@ -131,8 +131,8 @@ class _HomePageState extends ConsumerState with Functions { ], ), const SizedBox(height: 16), - LineChartWidget( - line1Data: const [ + const LineChartWidget( + line1Data: [ FlSpot(0, 3), FlSpot(1, 1.3), FlSpot(2, -2), @@ -151,8 +151,8 @@ class _HomePageState extends ConsumerState with Functions { FlSpot(15, -4.5), FlSpot(16, 2.5), ], - colorLine1Data: Theme.of(context).colorScheme.onSecondaryContainer, - line2Data: const [ + colorLine1Data: Color(0xff00152D), + line2Data: [ FlSpot(0, -3), FlSpot(1, -1.3), FlSpot(2, 2), @@ -185,8 +185,8 @@ class _HomePageState extends ConsumerState with Functions { FlSpot(29, 4.7), FlSpot(30, 1), ], - colorLine2Data: Colors.red, //da modificare in darkMode e capire a cosa fa riferimento - colorBackground: Theme.of(context).colorScheme.secondaryContainer, + colorLine2Data: Color(0xffB9BABC), //da modificare in darkMode + colorBackground: Color(0xffF1F5F9), maxY: 5.0, minY: -5.0, maxDays: 31.0, diff --git a/lib/pages/structure.dart b/lib/pages/structure.dart index 384d2ed..a773216 100644 --- a/lib/pages/structure.dart +++ b/lib/pages/structure.dart @@ -2,8 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import '../constants/style.dart'; -import '../pages/add_page/add_page.dart'; +import 'add_page/add_page.dart'; import '../pages/home_page.dart'; import '../pages/transactions_page/transactions_page.dart'; import '../pages/statistics_page.dart'; @@ -49,10 +48,7 @@ class _StructureState extends ConsumerState { centerTitle: true, title: Text( _pagesTitle.elementAt(selectedIndex), - style: TextStyle( - color: Theme.of(context).colorScheme.primary, - fontSize: Theme.of(context).textTheme.headlineLarge!.fontSize, - ), + style: Theme.of(context).textTheme.headlineLarge!, ), leading: Padding( padding: const EdgeInsets.only(left: 16), @@ -62,11 +58,11 @@ class _StructureState extends ConsumerState { elevation: 0, shape: const CircleBorder(), padding: const EdgeInsets.all(8), - backgroundColor: Theme.of(context).colorScheme.secondary, + backgroundColor: Theme.of(context).colorScheme.primary, ), - child: const Icon( + child: Icon( Icons.search, - color: white, + color: Theme.of(context).colorScheme.background, ), ), ), @@ -79,11 +75,11 @@ class _StructureState extends ConsumerState { elevation: 0, shape: const CircleBorder(), padding: const EdgeInsets.all(8), - backgroundColor: Theme.of(context).colorScheme.secondary, + backgroundColor: Theme.of(context).colorScheme.primary, ), - child: const Icon( + child: Icon( Icons.settings, - color: white, + color: Theme.of(context).colorScheme.background, ), ), ), @@ -99,7 +95,6 @@ class _StructureState extends ConsumerState { selectedFontSize: 8, unselectedFontSize: 8, // backgroundColor: const Color(0xFFF6F6F6), - currentIndex: selectedIndex, onTap: (index) => index != 2 ? ref.read(selectedIndexProvider.notifier).state = index @@ -108,7 +103,6 @@ class _StructureState extends ConsumerState { BottomNavigationBarItem( icon: Icon(selectedIndex == 0 ? Icons.home : Icons.home_outlined), label: "DASHBOARD", - ), BottomNavigationBarItem( icon: Icon(selectedIndex == 1 @@ -135,10 +129,10 @@ class _StructureState extends ConsumerState { elevation: 4, highlightElevation: 0, backgroundColor: Theme.of(context).colorScheme.secondary, - child: const Icon( + child: Icon( Icons.add_rounded, size: 55, - color: white, + color: Theme.of(context).colorScheme.background, ), onPressed: () async { showModalBottomSheet( diff --git a/lib/providers/categories_provider.dart b/lib/providers/categories_provider.dart index c25a1d7..2cd7869 100644 --- a/lib/providers/categories_provider.dart +++ b/lib/providers/categories_provider.dart @@ -1,3 +1,4 @@ +import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import '../constants/constants.dart'; import '../model/category_transaction.dart'; diff --git a/lib/utils/app_theme.dart b/lib/utils/app_theme.dart index 547e64f..6d0cb21 100644 --- a/lib/utils/app_theme.dart +++ b/lib/utils/app_theme.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; + import '../constants/style.dart'; class AppTheme { @@ -193,15 +194,13 @@ class AppTheme { ColorScheme customColorScheme = const ColorScheme( primary: blue1, primaryContainer: white, - secondaryContainer: blue7, secondary: blue5, tertiary: blue4, surface: grey3, background: white, error: red, onPrimary: white, - onSecondary: black, - onSecondaryContainer: blue6, + onSecondary: white, onSurface: blue1, onBackground: blue1, onError: black, @@ -211,15 +210,13 @@ ColorScheme customColorScheme = const ColorScheme( ColorScheme darkCustomColorScheme = const ColorScheme( primary: darkBlue1, primaryContainer: darkGrey4, - secondaryContainer: darkBlue7, secondary: darkBlue5, tertiary: darkBlack, surface: darkBlue7, //darkBlue3 background: darkWhite, error: darkRed, onPrimary: darkWhite, - onSecondary: darkBlack, - onSecondaryContainer: darkGrey2, + onSecondary: darkWhite, onSurface: darkBlue1, onBackground: darkBlue1, onError: darkBlack, From 2584d1d40d9d2faf8e16bb84986892d807a49c27 Mon Sep 17 00:00:00 2001 From: Giovanni Ercolano <75883612+giovanni-ercolano@users.noreply.github.com> Date: Sat, 25 Nov 2023 19:36:42 +0100 Subject: [PATCH 8/9] fix test databaseFactory --- test/widget/accounts_sum_test.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/test/widget/accounts_sum_test.dart b/test/widget/accounts_sum_test.dart index 5c5819d..231b87d 100644 --- a/test/widget/accounts_sum_test.dart +++ b/test/widget/accounts_sum_test.dart @@ -1,4 +1,5 @@ import 'package:flutter_test/flutter_test.dart'; +import 'package:sqflite/sqflite.dart'; import 'package:sqflite_common_ffi/sqflite_ffi.dart'; import 'package:flutter/material.dart'; import "dart:math"; From 3b696a961c91daddb635f99b634548a59bcbe4ee Mon Sep 17 00:00:00 2001 From: mikev-cw <113628339+mikev-cw@users.noreply.github.com> Date: Wed, 29 Nov 2023 22:50:54 +0100 Subject: [PATCH 9/9] Reverted system files --- android/build.gradle | 2 +- ios/Flutter/Debug.xcconfig | 1 - ios/Flutter/Release.xcconfig | 1 - ios/Runner.xcodeproj/project.pbxproj | 75 +--------- .../xcshareddata/xcschemes/Runner.xcscheme | 2 +- .../contents.xcworkspacedata | 3 - linux/flutter/generated_plugin_registrant.cc | 4 - linux/flutter/generated_plugins.cmake | 1 - macos/Flutter/Flutter-Debug.xcconfig | 1 - macos/Flutter/Flutter-Release.xcconfig | 1 - macos/Flutter/GeneratedPluginRegistrant.swift | 2 - pubspec.lock | 132 ++++-------------- .../flutter/generated_plugin_registrant.cc | 3 - windows/flutter/generated_plugins.cmake | 1 - 14 files changed, 30 insertions(+), 199 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 9bc02fa..8ac4d8e 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -26,6 +26,6 @@ subprojects { project.evaluationDependsOn(':app') } -tasks.register("clean", Delete) { +task clean(type: Delete) { delete rootProject.buildDir } diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig index ec97fc6..592ceee 100644 --- a/ios/Flutter/Debug.xcconfig +++ b/ios/Flutter/Debug.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig index c4855bf..592ceee 100644 --- a/ios/Flutter/Release.xcconfig +++ b/ios/Flutter/Release.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 5965abf..1ef0fea 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 54; + objectVersion = 50; objects = { /* Begin PBXBuildFile section */ @@ -13,7 +13,6 @@ 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - 9A75436DEC7A6FF3F8A32D5C /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF22E285055C5016D393F70 /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -32,12 +31,9 @@ /* Begin PBXFileReference section */ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 1AF22E285055C5016D393F70 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 25A2235A534A95679418095F /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 79C2A9A2F3C16FFFEC9526FB /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; @@ -46,7 +42,6 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - BFC9109ABA21D364DC38C69D /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -54,32 +49,12 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 9A75436DEC7A6FF3F8A32D5C /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 6ECDD2D0F41BE58642E2DD8E /* Frameworks */ = { - isa = PBXGroup; - children = ( - 1AF22E285055C5016D393F70 /* Pods_Runner.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 831E67E00C254CB6BEB94ED5 /* Pods */ = { - isa = PBXGroup; - children = ( - 79C2A9A2F3C16FFFEC9526FB /* Pods-Runner.debug.xcconfig */, - BFC9109ABA21D364DC38C69D /* Pods-Runner.release.xcconfig */, - 25A2235A534A95679418095F /* Pods-Runner.profile.xcconfig */, - ); - name = Pods; - path = Pods; - sourceTree = ""; - }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -97,8 +72,6 @@ 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, - 831E67E00C254CB6BEB94ED5 /* Pods */, - 6ECDD2D0F41BE58642E2DD8E /* Frameworks */, ); sourceTree = ""; }; @@ -132,14 +105,12 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - A2892F4F5D8157B747568834 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 7024F2D592551F05FDA378F8 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -156,7 +127,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1430; + LastUpgradeCheck = 1300; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { @@ -200,12 +171,10 @@ /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( - "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); name = "Thin Binary"; outputPaths = ( @@ -214,26 +183,8 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; - 7024F2D592551F05FDA378F8 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -246,28 +197,6 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; - A2892F4F5D8157B747568834 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index a6b826d..c87d15a 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ - - diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index 4c0025f..2c1ec4f 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -7,13 +7,9 @@ #include "generated_plugin_registrant.h" #include -#include void fl_register_plugins(FlPluginRegistry* registry) { g_autoptr(FlPluginRegistrar) sqlite3_flutter_libs_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "Sqlite3FlutterLibsPlugin"); sqlite3_flutter_libs_plugin_register_with_registrar(sqlite3_flutter_libs_registrar); - g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); - url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); } diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index ad279a8..7ea2a80 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -4,7 +4,6 @@ list(APPEND FLUTTER_PLUGIN_LIST sqlite3_flutter_libs - url_launcher_linux ) list(APPEND FLUTTER_FFI_PLUGIN_LIST diff --git a/macos/Flutter/Flutter-Debug.xcconfig b/macos/Flutter/Flutter-Debug.xcconfig index 4b81f9b..c2efd0b 100644 --- a/macos/Flutter/Flutter-Debug.xcconfig +++ b/macos/Flutter/Flutter-Debug.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/macos/Flutter/Flutter-Release.xcconfig b/macos/Flutter/Flutter-Release.xcconfig index 5caa9d1..c2efd0b 100644 --- a/macos/Flutter/Flutter-Release.xcconfig +++ b/macos/Flutter/Flutter-Release.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index b4e2147..4856abc 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -7,10 +7,8 @@ import Foundation import sqflite import sqlite3_flutter_libs -import url_launcher_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) Sqlite3FlutterLibsPlugin.register(with: registry.registrar(forPlugin: "Sqlite3FlutterLibsPlugin")) - UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) } diff --git a/pubspec.lock b/pubspec.lock index c0b6e6a..a6cffac 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: async - sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 url: "https://pub.dev" source: hosted - version: "2.11.0" + version: "2.10.0" boolean_selector: dependency: transitive description: @@ -53,10 +53,10 @@ packages: dependency: transitive description: name: characters - sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.2.1" checked_yaml: dependency: transitive description: @@ -93,10 +93,10 @@ packages: dependency: transitive description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.17.0" convert: dependency: transitive description: @@ -236,10 +236,10 @@ packages: dependency: transitive description: name: frontend_server_client - sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" + sha256: "4f4a162323c86ffc1245765cfe138872b8f069deb42f7dbb36115fa27f31469b" url: "https://pub.dev" source: hosted - version: "3.2.0" + version: "2.1.3" glob: dependency: transitive description: @@ -332,26 +332,26 @@ packages: dependency: transitive description: name: matcher - sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" url: "https://pub.dev" source: hosted - version: "0.12.16" + version: "0.12.13" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.2.0" meta: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.8.0" mime: dependency: transitive description: @@ -380,10 +380,10 @@ packages: dependency: transitive description: name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b url: "https://pub.dev" source: hosted - version: "1.8.3" + version: "1.8.2" percent_indicator: dependency: "direct main" description: @@ -400,14 +400,6 @@ packages: url: "https://pub.dev" source: hosted version: "5.1.0" - plugin_platform_interface: - dependency: transitive - description: - name: plugin_platform_interface - sha256: da3fdfeccc4d4ff2da8f8c556704c08f912542c5fb3cf2233ed75372384a034d - url: "https://pub.dev" - source: hosted - version: "2.1.6" pointycastle: dependency: transitive description: @@ -497,10 +489,10 @@ packages: dependency: transitive description: name: source_span - sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.9.1" sqflite: dependency: "direct main" description: @@ -593,26 +585,26 @@ packages: dependency: "direct dev" description: name: test - sha256: "13b41f318e2a5751c3169137103b60c584297353d4b1761b66029bae6411fe46" + sha256: a5fcd2d25eeadbb6589e80198a47d6a464ba3e2049da473943b8af9797900c2d url: "https://pub.dev" source: hosted - version: "1.24.3" + version: "1.22.0" test_api: dependency: transitive description: name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.4.16" test_core: dependency: transitive description: name: test_core - sha256: "99806e9e6d95c7b059b7a0fc08f07fc53fabe54a829497f0d9676299f1e8637e" + sha256: "0ef9755ec6d746951ba0aabe62f874b707690b5ede0fecc818b138fcc9b14888" url: "https://pub.dev" source: hosted - version: "0.5.3" + version: "0.4.20" typed_data: dependency: transitive description: @@ -629,70 +621,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.2.0" - url_launcher: - dependency: "direct main" - description: - name: url_launcher - sha256: eb1e00ab44303d50dd487aab67ebc575456c146c6af44422f9c13889984c00f3 - url: "https://pub.dev" - source: hosted - version: "6.1.11" - url_launcher_android: - dependency: transitive - description: - name: url_launcher_android - sha256: b04af59516ab45762b2ca6da40fa830d72d0f6045cd97744450b73493fa76330 - url: "https://pub.dev" - source: hosted - version: "6.1.0" - url_launcher_ios: - dependency: transitive - description: - name: url_launcher_ios - sha256: "7c65021d5dee51813d652357bc65b8dd4a6177082a9966bc8ba6ee477baa795f" - url: "https://pub.dev" - source: hosted - version: "6.1.5" - url_launcher_linux: - dependency: transitive - description: - name: url_launcher_linux - sha256: b651aad005e0cb06a01dbd84b428a301916dc75f0e7ea6165f80057fee2d8e8e - url: "https://pub.dev" - source: hosted - version: "3.0.6" - url_launcher_macos: - dependency: transitive - description: - name: url_launcher_macos - sha256: b55486791f666e62e0e8ff825e58a023fd6b1f71c49926483f1128d3bbd8fe88 - url: "https://pub.dev" - source: hosted - version: "3.0.7" - url_launcher_platform_interface: - dependency: transitive - description: - name: url_launcher_platform_interface - sha256: "95465b39f83bfe95fcb9d174829d6476216f2d548b79c38ab2506e0458787618" - url: "https://pub.dev" - source: hosted - version: "2.1.5" - url_launcher_web: - dependency: transitive - description: - name: url_launcher_web - sha256: ba140138558fcc3eead51a1c42e92a9fb074a1b1149ed3c73e66035b2ccd94f2 - url: "https://pub.dev" - source: hosted - version: "2.0.19" - url_launcher_windows: - dependency: transitive - description: - name: url_launcher_windows - sha256: "95fef3129dc7cfaba2bc3d5ba2e16063bb561fc6d78e63eee16162bc70029069" - url: "https://pub.dev" - source: hosted - version: "3.0.8" vector_math: dependency: transitive description: @@ -717,14 +645,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.2" - web: - dependency: transitive - description: - name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 - url: "https://pub.dev" - source: hosted - version: "0.1.4-beta" web_socket_channel: dependency: transitive description: @@ -758,5 +678,5 @@ packages: source: hosted version: "3.1.1" sdks: - dart: ">=3.1.0-185.0.dev <4.0.0" - flutter: ">=3.7.0" + dart: ">=2.18.0 <3.0.0" + flutter: ">=3.3.0" \ No newline at end of file diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 76d5285..988f3c8 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -7,11 +7,8 @@ #include "generated_plugin_registrant.h" #include -#include void RegisterPlugins(flutter::PluginRegistry* registry) { Sqlite3FlutterLibsPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("Sqlite3FlutterLibsPlugin")); - UrlLauncherWindowsRegisterWithRegistrar( - registry->GetRegistrarForPlugin("UrlLauncherWindows")); } diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 22aeaae..8abff95 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -4,7 +4,6 @@ list(APPEND FLUTTER_PLUGIN_LIST sqlite3_flutter_libs - url_launcher_windows ) list(APPEND FLUTTER_FFI_PLUGIN_LIST