From 5104fc674e74ef0d4c0865c4d277b21c72a120f9 Mon Sep 17 00:00:00 2001 From: hmalik144 Date: Wed, 7 Sep 2022 00:16:49 +0100 Subject: [PATCH] Ability to cache currency selection (#5) --- lib/BaseStatelessWidget.dart | 2 +- lib/Home.dart | 17 ++- lib/MainViewModel.dart | 178 +++--------------------- lib/Utils/Constants.dart | 160 ++++++++++++++++++++- lib/data/prefs/CurrencyPair.dart | 6 + lib/data/prefs/PreferenceProvider.dart | 27 ++++ lib/data/repository/Repository.dart | 6 + lib/data/repository/RepositoryImpl.dart | 20 +++ lib/locator.dart | 14 ++ lib/main.dart | 7 +- lib/views/DropDownBox.dart | 18 +-- pubspec.lock | 130 ++++++++++++++++- pubspec.yaml | 2 + 13 files changed, 415 insertions(+), 172 deletions(-) create mode 100644 lib/data/prefs/CurrencyPair.dart create mode 100644 lib/data/prefs/PreferenceProvider.dart create mode 100644 lib/data/repository/Repository.dart create mode 100644 lib/data/repository/RepositoryImpl.dart create mode 100644 lib/locator.dart diff --git a/lib/BaseStatelessWidget.dart b/lib/BaseStatelessWidget.dart index 462dd9d..8917518 100644 --- a/lib/BaseStatelessWidget.dart +++ b/lib/BaseStatelessWidget.dart @@ -19,7 +19,7 @@ abstract class BaseStatelessWidget Widget build(BuildContext parent) { return Scaffold( body: Container( - padding: const EdgeInsets.all(PADDING_GLOBAL), + padding: const EdgeInsets.all(paddingGlobal), decoration: const BoxDecoration( gradient: LinearGradient( begin: Alignment.topLeft, diff --git a/lib/Home.dart b/lib/Home.dart index f7477b6..abca767 100644 --- a/lib/Home.dart +++ b/lib/Home.dart @@ -7,6 +7,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/src/widgets/framework.dart'; import 'BaseStatelessWidget.dart'; +import 'Utils/Constants.dart'; class HomePage extends BaseStatelessWidget { @override @@ -15,11 +16,13 @@ class HomePage extends BaseStatelessWidget { } @override - Widget displayWidget( - BuildContext context, MainViewModel model, Widget? child) { + Widget displayWidget(BuildContext context, MainViewModel model, Widget? child) { TextEditingController controller1 = TextEditingController(); TextEditingController controller2 = TextEditingController(); + String selected1 = model.getConversionPair(SelectionType.conversionFrom); + String selected2 = model.getConversionPair(SelectionType.conversionTo); + return Column( mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -27,7 +30,10 @@ class HomePage extends BaseStatelessWidget { padding: const EdgeInsets.all(8.0), child: Column( children: [ - DropDownBox(model.data, (selected) {}), + DropDownBox(listOfCurrencies, selected1, (selected) { + selected1 = selected!; + model.setConversionPair(selected1, selected2); + }), ConverterEditText("Enter conversion from", controller1, (input) => { controller2.text = model.convertInput(input, SelectionType.conversionFrom) }) @@ -38,7 +44,10 @@ class HomePage extends BaseStatelessWidget { padding: const EdgeInsets.all(8.0), child: Column( children: [ - DropDownBox(model.data, (selected) {}), + DropDownBox(listOfCurrencies, selected2, (selected) { + selected2 = selected!; + model.setConversionPair(selected1, selected2); + }), ConverterEditText("Enter conversion from", controller2, (input) => { controller1.text = model.convertInput(input, SelectionType.conversionTo) }) diff --git a/lib/MainViewModel.dart b/lib/MainViewModel.dart index d283e58..7eb998c 100644 --- a/lib/MainViewModel.dart +++ b/lib/MainViewModel.dart @@ -1,165 +1,33 @@ import 'package:easy_cc_flutter/BaseViewModel.dart'; import 'package:easy_cc_flutter/Utils/SelectionType.dart'; +import 'Utils/Constants.dart'; +import 'data/prefs/CurrencyPair.dart'; +import 'data/repository/Repository.dart'; +import 'data/repository/RepositoryImpl.dart'; +import 'locator.dart'; + class MainViewModel extends BaseViewmodel { + final Repository _repository = locator(); double conversionRate = 1.4; - final List data = ['ALL - Albanian Lek', - 'AFN - Afghan Afghani', - 'DZD - Algerian Dinar', - 'AOA - Angolan Kwanza', - 'ARS - Argentine Peso', - 'AMD - Armenian Dram', - 'AWG - Aruban Florin', - 'AUD - Australian Dollar', - 'AZN - Azerbaijani Manat', - 'BSD - Bahamian Dollar', - 'BHD - Bahraini Dinar', - 'BDT - Bangladeshi Taka', - 'BBD - Barbadian Dollar', - 'BYR - Belarusian Ruble', - 'BZD - Belize Dollar', - 'BTN - Bhutanese Ngultrum', - 'BTC - Bitcoin', - 'BOB - Bolivian Boliviano', - 'BAM - Bosnia And Herzegovina Konvertibilna Marka', - 'BWP - Botswana Pula', - 'BRL - Brazilian Real', - 'GBP - British Pound', - 'BND - Brunei Dollar', - 'BGN - Bulgarian Lev', - 'BIF - Burundi Franc', - 'KHR - Cambodian Riel', - 'CAD - Canadian Dollar', - 'CVE - Cape Verdean Escudo', - 'KYD - Cayman Islands Dollar', - 'XAF - Central African CFA Franc', - 'XPF - CFP Franc', - 'CLP - Chilean Peso', - 'CNY - Chinese Yuan', - 'COP - Colombian Peso', - 'KMF - Comorian Franc', - 'CDF - Congolese Franc', - 'CRC - Costa Rican Colon', - 'HRK - Croatian Kuna', - 'CUP - Cuban Peso', - 'CZK - Czech Koruna', - 'DKK - Danish Krone', - 'DJF - Djiboutian Franc', - 'DOP - Dominican Peso', - 'XCD - East Caribbean Dollar', - 'EGP - Egyptian Pound', - 'ERN - Eritrean Nakfa', - 'ETB - Ethiopian Birr', - 'EUR - Euro', - 'FKP - Falkland Islands Pound', - 'FJD - Fijian Dollar', - 'GMD - Gambian Dalasi', - 'GEL - Georgian Lari', - 'GHS - Ghanaian Cedi', - 'GIP - Gibraltar Pound', - 'GTQ - Guatemalan Quetzal', - 'GNF - Guinean Franc', - 'GYD - Guyanese Dollar', - 'HTG - Haitian Gourde', - 'HNL - Honduran Lempira', - 'HKD - Hong Kong Dollar', - 'HUF - Hungarian Forint', - 'ISK - Icelandic Kr\u00f3na', - 'INR - Indian Rupee', - 'IDR - Indonesian Rupiah', - 'IRR - Iranian Rial', - 'IQD - Iraqi Dinar', - 'ILS - Israeli New Sheqel', - 'JMD - Jamaican Dollar', - 'JPY - Japanese Yen', - 'JOD - Jordanian Dinar', - 'KZT - Kazakhstani Tenge', - 'KES - Kenyan Shilling', - 'KWD - Kuwaiti Dinar', - 'KGS - Kyrgyzstani Som', - 'LAK - Lao Kip', - 'LVL - Latvian Lats', - 'LBP - Lebanese Lira', - 'LSL - Lesotho Loti', - 'LRD - Liberian Dollar', - 'LYD - Libyan Dinar', - 'MOP - Macanese Pataca', - 'MKD - Macedonian Denar', - 'MGA - Malagasy Ariary', - 'MWK - Malawian Kwacha', - 'MYR - Malaysian Ringgit', - 'MVR - Maldivian Rufiyaa', - 'MRO - Mauritanian Ouguiya', - 'MUR - Mauritian Rupee', - 'MXN - Mexican Peso', - 'MDL - Moldovan Leu', - 'MNT - Mongolian Tugrik', - 'MAD - Moroccan Dirham', - 'MZN - Mozambican Metical', - 'MMK - Myanma Kyat', - 'NAD - Namibian Dollar', - 'NPR - Nepalese Rupee', - 'ANG - Netherlands Antillean Gulden', - 'TWD - New Taiwan Dollar', - 'NZD - New Zealand Dollar', - 'NIO - Nicaraguan Cordoba', - 'NGN - Nigerian Naira', - 'KPW - North Korean Won', - 'NOK - Norwegian Krone', - 'OMR - Omani Rial', - 'TOP - Paanga', - 'PKR - Pakistani Rupee', - 'PAB - Panamanian Balboa', - 'PGK - Papua New Guinean Kina', - 'PYG - Paraguayan Guarani', - 'PEN - Peruvian Nuevo Sol', - 'PHP - Philippine Peso', - 'PLN - Polish Zloty', - 'QAR - Qatari Riyal', - 'RON - Romanian Leu', - 'RUB - Russian Ruble', - 'RWF - Rwandan Franc', - 'SHP - Saint Helena Pound', - 'WST - Samoan Tala', - 'STD - Sao Tome And Principe Dobra', - 'SAR - Saudi Riyal', - 'RSD - Serbian Dinar', - 'SCR - Seychellois Rupee', - 'SLL - Sierra Leonean Leone', - 'SGD - Singapore Dollar', - 'SBD - Solomon Islands Dollar', - 'SOS - Somali Shilling', - 'ZAR - South African Rand', - 'KRW - South Korean Won', - 'XDR - Special Drawing Rights', - 'LKR - Sri Lankan Rupee', - 'SDG - Sudanese Pound', - 'SRD - Surinamese Dollar', - 'SZL - Swazi Lilangeni', - 'SEK - Swedish Krona', - 'CHF - Swiss Franc', - 'SYP - Syrian Pound', - 'TJS - Tajikistani Somoni', - 'TZS - Tanzanian Shilling', - 'THB - Thai Baht', - 'TTD - Trinidad and Tobago Dollar', - 'TND - Tunisian Dinar', - 'TRY - Turkish New Lira', - 'TMT - Turkmenistan Manat', - 'AED - UAE Dirham', - 'UGX - Ugandan Shilling', - 'UAH - Ukrainian Hryvnia', - 'USD - United States Dollar', - 'UYU - Uruguayan Peso', - 'UZS - Uzbekistani Som', - 'VUV - Vanuatu Vatu', - 'VEF - Venezuelan Bolivar', - 'VND - Vietnamese Dong', - 'XOF - West African CFA Franc', - 'YER - Yemeni Rial', - 'ZMW - Zambian Kwacha']; + String getConversionPair(SelectionType type) { + CurrencyPair pair = _repository.getConversionPair(); + + switch (type) { + case SelectionType.conversionFrom: + return pair.currencyOne != null ? pair.currencyOne! : listOfCurrencies[0]; + case SelectionType.conversionTo: + return pair.currencyTwo != null ? pair.currencyTwo! : listOfCurrencies[0]; + default: + throw NullThrownError(); + } + } + + void setConversionPair(String fromCurrency, String toCurrency) { + _repository.setConversionPair(fromCurrency, toCurrency); + } String convertInput(String? input, SelectionType type) { if (input == null || input.isEmpty) { diff --git a/lib/Utils/Constants.dart b/lib/Utils/Constants.dart index b937973..4b54b68 100644 --- a/lib/Utils/Constants.dart +++ b/lib/Utils/Constants.dart @@ -6,4 +6,162 @@ const Color colourThree = Color(0xFF2978A0); const Color colourFour = Color(0xFF8549ff); const Color colourFive = Color(0xFFC6E0FF); -const double PADDING_GLOBAL = 12; \ No newline at end of file +const double paddingGlobal = 12; + +final List listOfCurrencies = [ + 'ALL - Albanian Lek', + 'AFN - Afghan Afghani', + 'DZD - Algerian Dinar', + 'AOA - Angolan Kwanza', + 'ARS - Argentine Peso', + 'AMD - Armenian Dram', + 'AWG - Aruban Florin', + 'AUD - Australian Dollar', + 'AZN - Azerbaijani Manat', + 'BSD - Bahamian Dollar', + 'BHD - Bahraini Dinar', + 'BDT - Bangladeshi Taka', + 'BBD - Barbadian Dollar', + 'BYR - Belarusian Ruble', + 'BZD - Belize Dollar', + 'BTN - Bhutanese Ngultrum', + 'BTC - Bitcoin', + 'BOB - Bolivian Boliviano', + 'BAM - Bosnia And Herzegovina Konvertibilna Marka', + 'BWP - Botswana Pula', + 'BRL - Brazilian Real', + 'GBP - British Pound', + 'BND - Brunei Dollar', + 'BGN - Bulgarian Lev', + 'BIF - Burundi Franc', + 'KHR - Cambodian Riel', + 'CAD - Canadian Dollar', + 'CVE - Cape Verdean Escudo', + 'KYD - Cayman Islands Dollar', + 'XAF - Central African CFA Franc', + 'XPF - CFP Franc', + 'CLP - Chilean Peso', + 'CNY - Chinese Yuan', + 'COP - Colombian Peso', + 'KMF - Comorian Franc', + 'CDF - Congolese Franc', + 'CRC - Costa Rican Colon', + 'HRK - Croatian Kuna', + 'CUP - Cuban Peso', + 'CZK - Czech Koruna', + 'DKK - Danish Krone', + 'DJF - Djiboutian Franc', + 'DOP - Dominican Peso', + 'XCD - East Caribbean Dollar', + 'EGP - Egyptian Pound', + 'ERN - Eritrean Nakfa', + 'ETB - Ethiopian Birr', + 'EUR - Euro', + 'FKP - Falkland Islands Pound', + 'FJD - Fijian Dollar', + 'GMD - Gambian Dalasi', + 'GEL - Georgian Lari', + 'GHS - Ghanaian Cedi', + 'GIP - Gibraltar Pound', + 'GTQ - Guatemalan Quetzal', + 'GNF - Guinean Franc', + 'GYD - Guyanese Dollar', + 'HTG - Haitian Gourde', + 'HNL - Honduran Lempira', + 'HKD - Hong Kong Dollar', + 'HUF - Hungarian Forint', + 'ISK - Icelandic Kr\u00f3na', + 'INR - Indian Rupee', + 'IDR - Indonesian Rupiah', + 'IRR - Iranian Rial', + 'IQD - Iraqi Dinar', + 'ILS - Israeli New Sheqel', + 'JMD - Jamaican Dollar', + 'JPY - Japanese Yen', + 'JOD - Jordanian Dinar', + 'KZT - Kazakhstani Tenge', + 'KES - Kenyan Shilling', + 'KWD - Kuwaiti Dinar', + 'KGS - Kyrgyzstani Som', + 'LAK - Lao Kip', + 'LVL - Latvian Lats', + 'LBP - Lebanese Lira', + 'LSL - Lesotho Loti', + 'LRD - Liberian Dollar', + 'LYD - Libyan Dinar', + 'MOP - Macanese Pataca', + 'MKD - Macedonian Denar', + 'MGA - Malagasy Ariary', + 'MWK - Malawian Kwacha', + 'MYR - Malaysian Ringgit', + 'MVR - Maldivian Rufiyaa', + 'MRO - Mauritanian Ouguiya', + 'MUR - Mauritian Rupee', + 'MXN - Mexican Peso', + 'MDL - Moldovan Leu', + 'MNT - Mongolian Tugrik', + 'MAD - Moroccan Dirham', + 'MZN - Mozambican Metical', + 'MMK - Myanma Kyat', + 'NAD - Namibian Dollar', + 'NPR - Nepalese Rupee', + 'ANG - Netherlands Antillean Gulden', + 'TWD - New Taiwan Dollar', + 'NZD - New Zealand Dollar', + 'NIO - Nicaraguan Cordoba', + 'NGN - Nigerian Naira', + 'KPW - North Korean Won', + 'NOK - Norwegian Krone', + 'OMR - Omani Rial', + 'TOP - Paanga', + 'PKR - Pakistani Rupee', + 'PAB - Panamanian Balboa', + 'PGK - Papua New Guinean Kina', + 'PYG - Paraguayan Guarani', + 'PEN - Peruvian Nuevo Sol', + 'PHP - Philippine Peso', + 'PLN - Polish Zloty', + 'QAR - Qatari Riyal', + 'RON - Romanian Leu', + 'RUB - Russian Ruble', + 'RWF - Rwandan Franc', + 'SHP - Saint Helena Pound', + 'WST - Samoan Tala', + 'STD - Sao Tome And Principe Dobra', + 'SAR - Saudi Riyal', + 'RSD - Serbian Dinar', + 'SCR - Seychellois Rupee', + 'SLL - Sierra Leonean Leone', + 'SGD - Singapore Dollar', + 'SBD - Solomon Islands Dollar', + 'SOS - Somali Shilling', + 'ZAR - South African Rand', + 'KRW - South Korean Won', + 'XDR - Special Drawing Rights', + 'LKR - Sri Lankan Rupee', + 'SDG - Sudanese Pound', + 'SRD - Surinamese Dollar', + 'SZL - Swazi Lilangeni', + 'SEK - Swedish Krona', + 'CHF - Swiss Franc', + 'SYP - Syrian Pound', + 'TJS - Tajikistani Somoni', + 'TZS - Tanzanian Shilling', + 'THB - Thai Baht', + 'TTD - Trinidad and Tobago Dollar', + 'TND - Tunisian Dinar', + 'TRY - Turkish New Lira', + 'TMT - Turkmenistan Manat', + 'AED - UAE Dirham', + 'UGX - Ugandan Shilling', + 'UAH - Ukrainian Hryvnia', + 'USD - United States Dollar', + 'UYU - Uruguayan Peso', + 'UZS - Uzbekistani Som', + 'VUV - Vanuatu Vatu', + 'VEF - Venezuelan Bolivar', + 'VND - Vietnamese Dong', + 'XOF - West African CFA Franc', + 'YER - Yemeni Rial', + 'ZMW - Zambian Kwacha' +]; \ No newline at end of file diff --git a/lib/data/prefs/CurrencyPair.dart b/lib/data/prefs/CurrencyPair.dart new file mode 100644 index 0000000..7f8f00b --- /dev/null +++ b/lib/data/prefs/CurrencyPair.dart @@ -0,0 +1,6 @@ +class CurrencyPair { + String? currencyOne; + String? currencyTwo; + + CurrencyPair(this.currencyOne, this.currencyTwo); +} \ No newline at end of file diff --git a/lib/data/prefs/PreferenceProvider.dart b/lib/data/prefs/PreferenceProvider.dart new file mode 100644 index 0000000..f1f5551 --- /dev/null +++ b/lib/data/prefs/PreferenceProvider.dart @@ -0,0 +1,27 @@ +import 'dart:ffi'; + +import 'package:shared_preferences/shared_preferences.dart'; + +import 'CurrencyPair.dart'; + +const String CURRENCY_ONE = "conversion_one"; +const String CURRENCY_TWO = "conversion_two"; +class PreferenceProvider { + late final SharedPreferences _prefs; + + Future init() async { + _prefs = await SharedPreferences.getInstance(); + } + + Future saveConversionPair(String s1, String s2) async { + await _prefs.setString(CURRENCY_ONE, s1); + await _prefs.setString(CURRENCY_TWO, s2); + } + + CurrencyPair getConversionPair() { + String? s1 = _prefs.getString(CURRENCY_ONE); + String? s2 = _prefs.getString(CURRENCY_TWO); + + return CurrencyPair(s1, s2); + } +} \ No newline at end of file diff --git a/lib/data/repository/Repository.dart b/lib/data/repository/Repository.dart new file mode 100644 index 0000000..68b3776 --- /dev/null +++ b/lib/data/repository/Repository.dart @@ -0,0 +1,6 @@ +import '../prefs/CurrencyPair.dart'; + +abstract class Repository { + CurrencyPair getConversionPair(); + Future setConversionPair(String fromCurrency, String toCurrency); +} \ No newline at end of file diff --git a/lib/data/repository/RepositoryImpl.dart b/lib/data/repository/RepositoryImpl.dart new file mode 100644 index 0000000..54abd1d --- /dev/null +++ b/lib/data/repository/RepositoryImpl.dart @@ -0,0 +1,20 @@ +import 'package:easy_cc_flutter/data/prefs/CurrencyPair.dart'; +import 'package:easy_cc_flutter/data/prefs/PreferenceProvider.dart'; + +import '../../locator.dart'; +import 'Repository.dart'; + +class RepositoryImpl extends Repository { + final PreferenceProvider _prefs = locator(); + + @override + CurrencyPair getConversionPair() { + return _prefs.getConversionPair(); + } + + @override + Future setConversionPair(String fromCurrency, String toCurrency) { + return _prefs.saveConversionPair(fromCurrency, toCurrency); + } + +} \ No newline at end of file diff --git a/lib/locator.dart b/lib/locator.dart new file mode 100644 index 0000000..3a2de65 --- /dev/null +++ b/lib/locator.dart @@ -0,0 +1,14 @@ +import 'package:easy_cc_flutter/MainViewModel.dart'; +import 'package:easy_cc_flutter/data/repository/RepositoryImpl.dart'; +import 'package:get_it/get_it.dart'; + +import 'data/prefs/PreferenceProvider.dart'; + +GetIt locator = GetIt.instance; + +void setupLocator() { + + locator.registerLazySingleton(() => PreferenceProvider()); + locator.registerLazySingleton(() => RepositoryImpl()); + locator.registerFactory(() => MainViewModel()); +} \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart index 05fdff5..0b96420 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,8 +1,13 @@ import 'package:flutter/material.dart'; import 'Home.dart'; +import 'data/prefs/PreferenceProvider.dart'; +import 'locator.dart'; -void main() { +void main() async { + WidgetsFlutterBinding.ensureInitialized(); + setupLocator(); + await locator().init(); runApp(const MyApp()); } diff --git a/lib/views/DropDownBox.dart b/lib/views/DropDownBox.dart index c6f9e15..9a12795 100644 --- a/lib/views/DropDownBox.dart +++ b/lib/views/DropDownBox.dart @@ -1,14 +1,15 @@ import 'package:dropdown_search/dropdown_search.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import '../Utils/Constants.dart'; class DropDownBox extends StatelessWidget { final List _selection; + final String _hintText; final Function(String?) _onChanged; - const DropDownBox(this._selection, this._onChanged, {super.key}); + const DropDownBox(this._selection, this._hintText, this._onChanged, + {super.key}); @override Widget build(BuildContext context) { @@ -18,20 +19,21 @@ class DropDownBox extends StatelessWidget { shape: const RoundedRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(22))), child: DropdownSearch( - popupProps: const PopupProps.dialog(showSearchBox: true), + popupProps: const PopupProps.dialog( + showSearchBox: true, + dialogProps: DialogProps(backgroundColor: colourThree)), items: _selection, - dropdownDecoratorProps: const DropDownDecoratorProps( + dropdownDecoratorProps: DropDownDecoratorProps( dropdownSearchDecoration: InputDecoration( - contentPadding: EdgeInsets.all(14), + contentPadding: const EdgeInsets.all(14), border: InputBorder.none, filled: true, fillColor: Colors.transparent, - hintText: "Select a currency", + hintText: _hintText, ), ), onChanged: _onChanged, ), ); } - -} \ No newline at end of file +} diff --git a/pubspec.lock b/pubspec.lock index e6d0b63..0df5222 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -71,6 +71,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.3.1" + ffi: + dependency: transitive + description: + name: ffi + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + file: + dependency: transitive + description: + name: file + url: "https://pub.dartlang.org" + source: hosted + version: "6.1.4" flutter: dependency: "direct main" description: flutter @@ -101,7 +115,7 @@ packages: source: hosted version: "4.6.5" get_it: - dependency: transitive + dependency: "direct main" description: name: get_it url: "https://pub.dartlang.org" @@ -163,6 +177,48 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.8.2" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.7" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.4" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.3" + platform: + dependency: transitive + description: + name: platform + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.0" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.2" + process: + dependency: transitive + description: + name: process + url: "https://pub.dartlang.org" + source: hosted + version: "4.2.4" provider: dependency: transitive description: @@ -177,6 +233,62 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.13.0" + shared_preferences: + dependency: "direct main" + description: + name: shared_preferences + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.15" + shared_preferences_android: + dependency: transitive + description: + name: shared_preferences_android + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.12" + shared_preferences_ios: + dependency: transitive + description: + name: shared_preferences_ios + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + shared_preferences_linux: + dependency: transitive + description: + name: shared_preferences_linux + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + shared_preferences_macos: + dependency: transitive + description: + name: shared_preferences_macos + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.4" + shared_preferences_platform_interface: + dependency: transitive + description: + name: shared_preferences_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.4" + shared_preferences_windows: + dependency: transitive + description: + name: shared_preferences_windows + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" sky_engine: dependency: transitive description: flutter @@ -280,6 +392,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.3" + win32: + dependency: transitive + description: + name: win32 + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0+2" sdks: dart: ">=2.18.0-190.0.dev <3.0.0" - flutter: ">=1.20.0" + flutter: ">=3.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 6592fe7..d98e6aa 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -42,6 +42,8 @@ dependencies: # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.2 + shared_preferences: ^2.0.15 + get_it: ^7.2.0 dev_dependencies: flutter_test: