From 607db82420bd23744fa100798eb8c79f19448605 Mon Sep 17 00:00:00 2001 From: Om Jogani Date: Thu, 19 Oct 2023 12:19:59 +0530 Subject: [PATCH 1/7] [Add]: History Local DB Communication --- ui/flutter/lib/api/model/history_data.dart | 9 + ui/flutter/lib/api/model/history_data.g.dart | 456 ++++++++++++++++++ .../app/modules/create/views/create_view.dart | 312 ++++++------ .../controller/history_controller.dart | 31 ++ .../modules/history/views/history_view.dart | 79 +++ ui/flutter/pubspec.yaml | 7 +- 6 files changed, 752 insertions(+), 142 deletions(-) create mode 100644 ui/flutter/lib/api/model/history_data.dart create mode 100644 ui/flutter/lib/api/model/history_data.g.dart create mode 100644 ui/flutter/lib/app/modules/history/controller/history_controller.dart create mode 100644 ui/flutter/lib/app/modules/history/views/history_view.dart diff --git a/ui/flutter/lib/api/model/history_data.dart b/ui/flutter/lib/api/model/history_data.dart new file mode 100644 index 000000000..9463ea33c --- /dev/null +++ b/ui/flutter/lib/api/model/history_data.dart @@ -0,0 +1,9 @@ +import 'package:isar/isar.dart'; + +part 'history_data.g.dart'; + +@collection +class HistoryData { + Id id = Isar.autoIncrement; + String? text; +} \ No newline at end of file diff --git a/ui/flutter/lib/api/model/history_data.g.dart b/ui/flutter/lib/api/model/history_data.g.dart new file mode 100644 index 000000000..37aa27bc7 --- /dev/null +++ b/ui/flutter/lib/api/model/history_data.g.dart @@ -0,0 +1,456 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'history_data.dart'; + +// ************************************************************************** +// IsarCollectionGenerator +// ************************************************************************** + +// coverage:ignore-file +// ignore_for_file: duplicate_ignore, non_constant_identifier_names, constant_identifier_names, invalid_use_of_protected_member, unnecessary_cast, prefer_const_constructors, lines_longer_than_80_chars, require_trailing_commas, inference_failure_on_function_invocation, unnecessary_parenthesis, unnecessary_raw_strings, unnecessary_null_checks, join_return_with_assignment, prefer_final_locals, avoid_js_rounded_ints, avoid_positional_boolean_parameters, always_specify_types + +extension GetHistoryDataCollection on Isar { + IsarCollection get historyDatas => this.collection(); +} + +const HistoryDataSchema = CollectionSchema( + name: r'HistoryData', + id: -544430032606042105, + properties: { + r'text': PropertySchema( + id: 0, + name: r'text', + type: IsarType.string, + ) + }, + estimateSize: _historyDataEstimateSize, + serialize: _historyDataSerialize, + deserialize: _historyDataDeserialize, + deserializeProp: _historyDataDeserializeProp, + idName: r'id', + indexes: {}, + links: {}, + embeddedSchemas: {}, + getId: _historyDataGetId, + getLinks: _historyDataGetLinks, + attach: _historyDataAttach, + version: '3.1.0+1', +); + +int _historyDataEstimateSize( + HistoryData object, + List offsets, + Map> allOffsets, +) { + var bytesCount = offsets.last; + { + final value = object.text; + if (value != null) { + bytesCount += 3 + value.length * 3; + } + } + return bytesCount; +} + +void _historyDataSerialize( + HistoryData object, + IsarWriter writer, + List offsets, + Map> allOffsets, +) { + writer.writeString(offsets[0], object.text); +} + +HistoryData _historyDataDeserialize( + Id id, + IsarReader reader, + List offsets, + Map> allOffsets, +) { + final object = HistoryData(); + object.id = id; + object.text = reader.readStringOrNull(offsets[0]); + return object; +} + +P _historyDataDeserializeProp

( + IsarReader reader, + int propertyId, + int offset, + Map> allOffsets, +) { + switch (propertyId) { + case 0: + return (reader.readStringOrNull(offset)) as P; + default: + throw IsarError('Unknown property with id $propertyId'); + } +} + +Id _historyDataGetId(HistoryData object) { + return object.id; +} + +List> _historyDataGetLinks(HistoryData object) { + return []; +} + +void _historyDataAttach( + IsarCollection col, Id id, HistoryData object) { + object.id = id; +} + +extension HistoryDataQueryWhereSort + on QueryBuilder { + QueryBuilder anyId() { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause(const IdWhereClause.any()); + }); + } +} + +extension HistoryDataQueryWhere + on QueryBuilder { + QueryBuilder idEqualTo(Id id) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause(IdWhereClause.between( + lower: id, + upper: id, + )); + }); + } + + QueryBuilder idNotEqualTo( + Id id) { + return QueryBuilder.apply(this, (query) { + if (query.whereSort == Sort.asc) { + return query + .addWhereClause( + IdWhereClause.lessThan(upper: id, includeUpper: false), + ) + .addWhereClause( + IdWhereClause.greaterThan(lower: id, includeLower: false), + ); + } else { + return query + .addWhereClause( + IdWhereClause.greaterThan(lower: id, includeLower: false), + ) + .addWhereClause( + IdWhereClause.lessThan(upper: id, includeUpper: false), + ); + } + }); + } + + QueryBuilder idGreaterThan(Id id, + {bool include = false}) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause( + IdWhereClause.greaterThan(lower: id, includeLower: include), + ); + }); + } + + QueryBuilder idLessThan(Id id, + {bool include = false}) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause( + IdWhereClause.lessThan(upper: id, includeUpper: include), + ); + }); + } + + QueryBuilder idBetween( + Id lowerId, + Id upperId, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause(IdWhereClause.between( + lower: lowerId, + includeLower: includeLower, + upper: upperId, + includeUpper: includeUpper, + )); + }); + } +} + +extension HistoryDataQueryFilter + on QueryBuilder { + QueryBuilder idEqualTo( + Id value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'id', + value: value, + )); + }); + } + + QueryBuilder idGreaterThan( + Id value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'id', + value: value, + )); + }); + } + + QueryBuilder idLessThan( + Id value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'id', + value: value, + )); + }); + } + + QueryBuilder idBetween( + Id lower, + Id upper, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'id', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + )); + }); + } + + QueryBuilder textIsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNull( + property: r'text', + )); + }); + } + + QueryBuilder + textIsNotNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNotNull( + property: r'text', + )); + }); + } + + QueryBuilder textEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'text', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder textGreaterThan( + String? value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'text', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder textLessThan( + String? value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'text', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder textBetween( + String? lower, + String? upper, { + bool includeLower = true, + bool includeUpper = true, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'text', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder textStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'text', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder textEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'text', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder textContains( + String value, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'text', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder textMatches( + String pattern, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'text', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder textIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'text', + value: '', + )); + }); + } + + QueryBuilder + textIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'text', + value: '', + )); + }); + } +} + +extension HistoryDataQueryObject + on QueryBuilder {} + +extension HistoryDataQueryLinks + on QueryBuilder {} + +extension HistoryDataQuerySortBy + on QueryBuilder { + QueryBuilder sortByText() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'text', Sort.asc); + }); + } + + QueryBuilder sortByTextDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'text', Sort.desc); + }); + } +} + +extension HistoryDataQuerySortThenBy + on QueryBuilder { + QueryBuilder thenById() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'id', Sort.asc); + }); + } + + QueryBuilder thenByIdDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'id', Sort.desc); + }); + } + + QueryBuilder thenByText() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'text', Sort.asc); + }); + } + + QueryBuilder thenByTextDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'text', Sort.desc); + }); + } +} + +extension HistoryDataQueryWhereDistinct + on QueryBuilder { + QueryBuilder distinctByText( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'text', caseSensitive: caseSensitive); + }); + } +} + +extension HistoryDataQueryProperty + on QueryBuilder { + QueryBuilder idProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'id'); + }); + } + + QueryBuilder textProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'text'); + }); + } +} diff --git a/ui/flutter/lib/app/modules/create/views/create_view.dart b/ui/flutter/lib/app/modules/create/views/create_view.dart index ac804aa9a..816928782 100644 --- a/ui/flutter/lib/app/modules/create/views/create_view.dart +++ b/ui/flutter/lib/app/modules/create/views/create_view.dart @@ -4,9 +4,9 @@ import 'package:file_picker/file_picker.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:get/get.dart'; +import 'package:gopeed/app/modules/history/views/history_view.dart'; import '../../../../api/model/resolve_result.dart'; import 'package:rounded_loading_button/rounded_loading_button.dart'; - import '../../../../api/api.dart'; import '../../../../api/model/create_task.dart'; import '../../../../api/model/options.dart'; @@ -84,154 +84,186 @@ class CreateView extends GetView { FocusScope.of(context).requestFocus(FocusNode()); }, child: Padding( - padding: - const EdgeInsets.symmetric(vertical: 16.0, horizontal: 24.0), - child: Form( - key: _resolveFormKey, - autovalidateMode: AutovalidateMode.onUserInteraction, - child: Column(children: [ - Row(children: [ - Expanded( - child: TextFormField( - autofocus: true, - controller: _urlController, - minLines: 1, - maxLines: 5, - decoration: InputDecoration( - hintText: _hitText(), - hintStyle: const TextStyle(fontSize: 12), - labelText: 'downloadLink'.tr, - icon: const Icon(Icons.link), - suffixIcon: IconButton( - onPressed: () { - _urlController.clear(); - controller.clearFileDataUri(); - }, - icon: const Icon(Icons.clear), - ), + padding: + const EdgeInsets.symmetric(vertical: 16.0, horizontal: 24.0), + child: Form( + key: _resolveFormKey, + autovalidateMode: AutovalidateMode.onUserInteraction, + child: Column( + children: [ + Row(children: [ + Expanded( + child: TextFormField( + autofocus: true, + controller: _urlController, + minLines: 1, + maxLines: 5, + decoration: InputDecoration( + hintText: _hitText(), + hintStyle: const TextStyle(fontSize: 12), + labelText: 'downloadLink'.tr, + icon: const Icon(Icons.link), + suffixIcon: IconButton( + onPressed: () { + _urlController.clear(); + controller.clearFileDataUri(); + }, + icon: const Icon(Icons.clear), ), - validator: (v) { - return v!.trim().isNotEmpty - ? null - : 'downloadLinkValid'.tr; - }, - onChanged: (v) async { - controller.clearFileDataUri(); - }, ), + validator: (v) { + return v!.trim().isNotEmpty + ? null + : 'downloadLinkValid'.tr; + }, + onChanged: (v) async { + controller.clearFileDataUri(); + }, ), - IconButton( - icon: const Icon(Icons.folder_open), - onPressed: () async { - var pr = await FilePicker.platform.pickFiles( - type: FileType.custom, - allowedExtensions: ["torrent"]); - if (pr != null) { - if (!Util.isWeb()) { - _urlController.text = pr.files[0].path ?? ""; - return; - } - _urlController.text = pr.files[0].name; - controller.setFileDataUri(pr.files[0].bytes!); - } - }), - ] - //.where((e) => e != null).map((e) => e!).toList(), - ), - Obx(() => Visibility( - visible: controller.showAdvanced.value, - child: Padding( - padding: const EdgeInsets.only(left: 40, top: 15), - child: Column( - children: [ - TabBar( - controller: controller.advancedTabController, - tabs: const [ - Tab( - text: 'HTTP', - ), - Tab( - text: 'BitTorrent', - ) - ], + ), + IconButton( + icon: const Icon(Icons.folder_open), + onPressed: () async { + var pr = await FilePicker.platform.pickFiles( + type: FileType.custom, + allowedExtensions: ["torrent"]); + if (pr != null) { + if (!Util.isWeb()) { + _urlController.text = pr.files[0].path ?? ""; + return; + } + _urlController.text = pr.files[0].name; + controller.setFileDataUri(pr.files[0].bytes!); + } + }, + ), + IconButton( + icon: const Icon(Icons.history), + onPressed: () async { + // open up popup + showGeneralDialog( + barrierColor: Colors.black.withOpacity(0.5), + transitionBuilder: (context, a1, a2, widget) { + return Transform.scale( + scale: a1.value, + child: Opacity( + opacity: a1.value, + child: HistoryView(), ), - AutoScaleTabBarView( - controller: controller.advancedTabController, - children: [ - Column( - children: [ - TextFormField( - controller: _httpUaController, - decoration: const InputDecoration( - labelText: 'User-Agent', - )), - TextFormField( - controller: _httpCookieController, - decoration: const InputDecoration( - labelText: 'Cookie', - )), - TextFormField( - controller: _httpRefererController, - decoration: const InputDecoration( - labelText: 'Referer', - )), - ], - ), - Column( - children: [ - TextFormField( - controller: _btTrackerController, - maxLines: 5, - decoration: InputDecoration( - labelText: 'Trakers', - hintText: 'addTrackerHit'.tr, - )), - ], - ) - ], - ) - ], - ), - ))), - Center( - child: Padding( - padding: const EdgeInsets.only(top: 15), - child: Column( - children: [ - Padding( - padding: const EdgeInsets.only(right: 10), - child: TextButton( - onPressed: () { - controller.showAdvanced.value = - !controller.showAdvanced.value; - }, - child: Row( - mainAxisSize: MainAxisSize.min, + ); + }, + transitionDuration: const Duration(milliseconds: 250), + barrierDismissible: true, + barrierLabel: '', + context: context, + pageBuilder: (context, animation1, animation2) { + return const Text('PAGE BUILDER'); + }, + ); + // show list of history + }, + ), + ] + //.where((e) => e != null).map((e) => e!).toList(), + ), + Obx(() => Visibility( + visible: controller.showAdvanced.value, + child: Padding( + padding: const EdgeInsets.only(left: 40, top: 15), + child: Column( + children: [ + TabBar( + controller: controller.advancedTabController, + tabs: const [ + Tab( + text: 'HTTP', + ), + Tab( + text: 'BitTorrent', + ) + ], + ), + AutoScaleTabBarView( + controller: controller.advancedTabController, + children: [ + Column( + children: [ + TextFormField( + controller: _httpUaController, + decoration: const InputDecoration( + labelText: 'User-Agent', + )), + TextFormField( + controller: _httpCookieController, + decoration: const InputDecoration( + labelText: 'Cookie', + )), + TextFormField( + controller: _httpRefererController, + decoration: const InputDecoration( + labelText: 'Referer', + )), + ], + ), + Column( children: [ - Obx(() => Checkbox( - value: controller.showAdvanced.value, - onChanged: (bool? value) { - controller.showAdvanced.value = - value ?? false; - }, + TextFormField( + controller: _btTrackerController, + maxLines: 5, + decoration: InputDecoration( + labelText: 'Trakers', + hintText: 'addTrackerHit'.tr, )), - Text('advancedOptions'.tr), - ]), + ], + ) + ], + ) + ], + ), + ))), + Center( + child: Padding( + padding: const EdgeInsets.only(top: 15), + child: Column( + children: [ + Padding( + padding: const EdgeInsets.only(right: 10), + child: TextButton( + onPressed: () { + controller.showAdvanced.value = + !controller.showAdvanced.value; + }, + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Obx(() => Checkbox( + value: controller.showAdvanced.value, + onChanged: (bool? value) { + controller.showAdvanced.value = + value ?? false; + }, + )), + Text('advancedOptions'.tr), + ], ), ), - SizedBox( - width: 150, - child: RoundedLoadingButton( - color: Get.theme.colorScheme.secondary, - onPressed: _doResolve, - controller: _confirmController, - child: Text('confirm'.tr), - ), + ), + SizedBox( + width: 150, + child: RoundedLoadingButton( + color: Get.theme.colorScheme.secondary, + onPressed: _doResolve, + controller: _confirmController, + child: Text('confirm'.tr), ), - ], - ), - )), - ]))), + ), + ], + ), + )), + ], + ), + ), + ), ), ), ); diff --git a/ui/flutter/lib/app/modules/history/controller/history_controller.dart b/ui/flutter/lib/app/modules/history/controller/history_controller.dart new file mode 100644 index 000000000..d5e05a806 --- /dev/null +++ b/ui/flutter/lib/app/modules/history/controller/history_controller.dart @@ -0,0 +1,31 @@ +import 'package:gopeed/api/model/history_data.dart'; +import 'package:isar/isar.dart'; +import 'package:path_provider/path_provider.dart'; + +class HistoryController { + Future> getAllHistory() async { + final dir = await getApplicationDocumentsDirectory(); + + final isar = await Isar.open( + [HistoryDataSchema], + directory: dir.path, + ); + List data = await isar.historyDatas.where().findAll(); + await isar.close(); + return data; + } + + void addHistory(HistoryData data) async { + final dir = await getApplicationDocumentsDirectory(); + + final isar = await Isar.open( + [HistoryDataSchema], + directory: dir.path, + ); + + await isar.writeTxn(() async { + await isar.historyDatas.put(data); + }); + await isar.close(); + } +} diff --git a/ui/flutter/lib/app/modules/history/views/history_view.dart b/ui/flutter/lib/app/modules/history/views/history_view.dart new file mode 100644 index 000000000..78d2d5d50 --- /dev/null +++ b/ui/flutter/lib/app/modules/history/views/history_view.dart @@ -0,0 +1,79 @@ +import 'package:flutter/material.dart'; +import 'package:gopeed/api/model/history_data.dart'; +import 'package:gopeed/app/modules/history/controller/history_controller.dart'; +import 'package:isar/isar.dart'; +import 'package:path_provider/path_provider.dart'; + +class HistoryView extends StatefulWidget { + const HistoryView({super.key}); + + @override + State createState() => _HistoryViewState(); +} + +class _HistoryViewState extends State { + List listOfHistoryData = []; + HistoryController _controller = HistoryController(); + @override + void initState() { + super.initState(); + getAllHistory(); + } + + void getAllHistory() async { + List resultOfHistories = await _controller.getAllHistory(); + setState(() { + listOfHistoryData = resultOfHistories; + }); + } + + @override + Widget build(BuildContext context) { + final Size size = MediaQuery.sizeOf(context); + return Scaffold( + backgroundColor: Colors.transparent, + body: Dialog( + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)), + elevation: 0, + backgroundColor: Colors.transparent, + child: Container( + width: size.width * 0.8, + height: size.height * 0.8, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10.0), + ), + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: listOfHistoryData.isEmpty + ? const [ + Icon( + Icons.manage_history_rounded, + ), + SizedBox( + height: 10.0, + ), + Text( + "No History Found", + ), + ] + : [ + Expanded( + child: ListView.builder( + itemBuilder: (context, index) { + return ListTile( + title: Text( + listOfHistoryData[index].text.toString(), + ), + ); + }, + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/ui/flutter/pubspec.yaml b/ui/flutter/pubspec.yaml index 91de6df80..1cb05d096 100644 --- a/ui/flutter/pubspec.yaml +++ b/ui/flutter/pubspec.yaml @@ -41,7 +41,7 @@ dependencies: context_menus: ^1.0.2 json_annotation: ^4.6.0 dio: ^5.2.1 - path_provider: ^2.0.11 + path_provider: ^2.1.1 file_picker: 5.3.1 macos_secure_bookmarks: ^0.2.1 rounded_loading_button: ^2.1.0 @@ -60,6 +60,8 @@ dependencies: autoscale_tabbarview: ^1.0.2 share_plus: ^7.1.0 open_file: ^3.3.2 + isar: ^3.1.0+1 + isar_flutter_libs: ^3.1.0+1 dev_dependencies: flutter_test: sdk: flutter @@ -72,9 +74,10 @@ dev_dependencies: flutter_lints: ^2.0.0 ffigen: ^8.0.2 # build json model: flutter pub run build_runner build --delete-conflicting-outputs - build_runner: ^2.2.1 + build_runner: ^2.4.6 json_serializable: ^6.3.2 flutter_launcher_icons: ^0.13.1 + isar_generator: ^3.1.0+1 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec From 2122185799978bd1271fe00d424a3da217b48118 Mon Sep 17 00:00:00 2001 From: Om Jogani Date: Thu, 19 Oct 2023 12:20:47 +0530 Subject: [PATCH 2/7] [Fix]: History View Unused Imports Warnings --- ui/flutter/lib/app/modules/history/views/history_view.dart | 2 -- 1 file changed, 2 deletions(-) diff --git a/ui/flutter/lib/app/modules/history/views/history_view.dart b/ui/flutter/lib/app/modules/history/views/history_view.dart index 78d2d5d50..259074e7f 100644 --- a/ui/flutter/lib/app/modules/history/views/history_view.dart +++ b/ui/flutter/lib/app/modules/history/views/history_view.dart @@ -1,8 +1,6 @@ import 'package:flutter/material.dart'; import 'package:gopeed/api/model/history_data.dart'; import 'package:gopeed/app/modules/history/controller/history_controller.dart'; -import 'package:isar/isar.dart'; -import 'package:path_provider/path_provider.dart'; class HistoryView extends StatefulWidget { const HistoryView({super.key}); From c70454a0be4cf41830987e2ab77ac159a946b6cc Mon Sep 17 00:00:00 2001 From: Om Jogani Date: Thu, 19 Oct 2023 12:25:30 +0530 Subject: [PATCH 3/7] [Add]: Added pubspec.lock file --- ui/flutter/pubspec.lock | 542 +++++++++++++++++++++------------------- 1 file changed, 291 insertions(+), 251 deletions(-) diff --git a/ui/flutter/pubspec.lock b/ui/flutter/pubspec.lock index 46b53f781..325d545bc 100644 --- a/ui/flutter/pubspec.lock +++ b/ui/flutter/pubspec.lock @@ -5,40 +5,40 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: "0816708f5fbcacca324d811297153fe3c8e047beb5c6752e12292d2974c17045" - url: "https://pub.flutter-io.cn" + sha256: ae92f5d747aee634b87f89d9946000c2de774be1d6ac3e58268224348cd0101a + url: "https://pub.dev" source: hosted - version: "62.0.0" + version: "61.0.0" analyzer: dependency: transitive description: name: analyzer - sha256: "21862995c9932cd082f89d72ae5f5e2c110d1a0204ad06e4ebaee8307b76b834" - url: "https://pub.flutter-io.cn" + sha256: ea3d8652bda62982addfd92fdc2d0214e5f82e43325104990d4f4c4a2a313562 + url: "https://pub.dev" source: hosted - version: "6.0.0" + version: "5.13.0" app_links: dependency: "direct main" description: name: app_links sha256: "16725e716afd0634a5441654b1dda2b6c5557aa230884b5e1f41a5aa546a4cb6" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "3.4.3" archive: dependency: transitive description: name: archive - sha256: "0c8368c9b3f0abbc193b9d6133649a614204b528982bebc7026372d61677ce3a" - url: "https://pub.flutter-io.cn" + sha256: e0902a06f0e00414e4e3438a084580161279f137aeb862274710f29ec10cf01e + url: "https://pub.dev" source: hosted - version: "3.3.7" + version: "3.3.9" args: dependency: transitive description: name: args sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.4.2" async: @@ -46,7 +46,7 @@ packages: description: name: async sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.11.0" autoscale_tabbarview: @@ -54,23 +54,23 @@ packages: description: name: autoscale_tabbarview sha256: "29449e8876185acc4763cc6cf26ffcc3f842f42f1502d5964c6d85f489ee1bc4" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.0.2" badges: dependency: "direct main" description: name: badges - sha256: "6e7f3ec561ec08f47f912cfe349d4a1707afdc8dda271e17b046aa6d42c89e77" - url: "https://pub.flutter-io.cn" + sha256: a7b6bbd60dce418df0db3058b53f9d083c22cdb5132a052145dc267494df0b84 + url: "https://pub.dev" source: hosted - version: "3.1.1" + version: "3.1.2" boolean_selector: dependency: transitive description: name: boolean_selector sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.1.1" build: @@ -78,7 +78,7 @@ packages: description: name: build sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.4.1" build_config: @@ -86,7 +86,7 @@ packages: description: name: build_config sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.1.1" build_daemon: @@ -94,23 +94,23 @@ packages: description: name: build_daemon sha256: "5f02d73eb2ba16483e693f80bee4f088563a820e47d1027d4cdfe62b5bb43e65" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "4.0.0" build_resolvers: dependency: transitive description: name: build_resolvers - sha256: "6c4dd11d05d056e76320b828a1db0fc01ccd376922526f8e9d6c796a5adbac20" - url: "https://pub.flutter-io.cn" + sha256: d912852cce27c9e80a93603db721c267716894462e7033165178b91138587972 + url: "https://pub.dev" source: hosted - version: "2.2.1" + version: "2.3.2" build_runner: dependency: "direct dev" description: name: build_runner sha256: "10c6bcdbf9d049a0b666702cf1cee4ddfdc38f02a19d35ae392863b47519848b" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.4.6" build_runner_core: @@ -118,7 +118,7 @@ packages: description: name: build_runner_core sha256: "6d6ee4276b1c5f34f21fdf39425202712d2be82019983d52f351c94aafbc2c41" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "7.2.10" built_collection: @@ -126,23 +126,23 @@ packages: description: name: built_collection sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "5.1.1" built_value: dependency: transitive description: name: built_value - sha256: "598a2a682e2a7a90f08ba39c0aaa9374c5112340f0a2e275f61b59389543d166" - url: "https://pub.flutter-io.cn" + sha256: ff627b645b28fb8bdb69e645f910c2458fd6b65f6585c3a53e0626024897dedf + url: "https://pub.dev" source: hosted - version: "8.6.1" + version: "8.6.2" characters: dependency: transitive description: name: characters sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.3.0" checked_yaml: @@ -150,7 +150,7 @@ packages: description: name: checked_yaml sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.0.3" cli_util: @@ -158,7 +158,7 @@ packages: description: name: cli_util sha256: b8db3080e59b2503ca9e7922c3df2072cf13992354d5e944074ffa836fba43b7 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "0.4.0" clock: @@ -166,31 +166,31 @@ packages: description: name: clock sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.1.1" code_builder: dependency: transitive description: name: code_builder - sha256: "4ad01d6e56db961d29661561effde45e519939fdaeb46c351275b182eac70189" - url: "https://pub.flutter-io.cn" + sha256: "315a598c7fbe77f22de1c9da7cfd6fd21816312f16ffa124453b4fc679e540f1" + url: "https://pub.dev" source: hosted - version: "4.5.0" + version: "4.6.0" collection: dependency: transitive description: name: collection - sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" - url: "https://pub.flutter-io.cn" + sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + url: "https://pub.dev" source: hosted - version: "1.17.1" + version: "1.17.2" context_menus: dependency: "direct main" description: name: context_menus sha256: "25313f2a17dc936f541f8012761648cb58d936c5d6f6bf7282f137a4b9dedddb" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.0.2" convert: @@ -198,87 +198,87 @@ packages: description: name: convert sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "3.1.1" cross_file: dependency: transitive description: name: cross_file - sha256: "0b0036e8cccbfbe0555fd83c1d31a6f30b77a96b598b35a5d36dd41f718695e9" - url: "https://pub.flutter-io.cn" + sha256: fd832b5384d0d6da4f6df60b854d33accaaeb63aa9e10e736a87381f08dee2cb + url: "https://pub.dev" source: hosted - version: "0.3.3+4" + version: "0.3.3+5" crypto: dependency: transitive description: name: crypto sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "3.0.3" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be - url: "https://pub.flutter-io.cn" + sha256: d57953e10f9f8327ce64a508a355f0b1ec902193f66288e8cb5070e7c47eeb2d + url: "https://pub.dev" source: hosted - version: "1.0.5" - dart_internal: - dependency: transitive - description: - name: dart_internal - sha256: dae3976f383beddcfcd07ad5291a422df2c8c0a8a03c52cda63ac7b4f26e0f4e - url: "https://pub.flutter-io.cn" - source: hosted - version: "0.2.8" + version: "1.0.6" dart_style: dependency: transitive description: name: dart_style sha256: "1efa911ca7086affd35f463ca2fc1799584fb6aa89883cf0af8e3664d6a02d55" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.3.2" + dartx: + dependency: transitive + description: + name: dartx + sha256: "8b25435617027257d43e6508b5fe061012880ddfdaa75a71d607c3de2a13d244" + url: "https://pub.dev" + source: hosted + version: "1.2.0" desktop_drop: dependency: "direct main" description: name: desktop_drop sha256: ebba9c9cb0b54385998a977d741cc06fd8324878c08d5a36e9da61cd56b04cc6 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "0.4.3" dio: dependency: "direct main" description: name: dio - sha256: a9d76e72985d7087eb7c5e7903224ae52b337131518d127c554b9405936752b8 - url: "https://pub.flutter-io.cn" + sha256: ce75a1b40947fea0a0e16ce73337122a86762e38b982e1ccb909daa3b9bc4197 + url: "https://pub.dev" source: hosted - version: "5.2.1+1" + version: "5.3.2" fake_async: dependency: transitive description: name: fake_async sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.3.1" ffi: dependency: transitive description: name: ffi - sha256: ed5337a5660c506388a9f012be0288fb38b49020ce2b45fe1f8b8323fe429f99 - url: "https://pub.flutter-io.cn" + sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" + url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.1.0" ffigen: dependency: "direct dev" description: name: ffigen sha256: d3e76c2ad48a4e7f93a29a162006f00eba46ce7c08194a77bb5c5e97d1b5ff0a - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "8.0.2" file: @@ -286,7 +286,7 @@ packages: description: name: file sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "6.1.4" file_picker: @@ -294,7 +294,7 @@ packages: description: name: file_picker sha256: "9d6e95ec73abbd31ec54d0e0df8a961017e165aba1395e462e5b31ea0c165daf" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "5.3.1" fixnum: @@ -302,17 +302,17 @@ packages: description: name: fixnum sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.1.0" fluent_ui: dependency: "direct main" description: name: fluent_ui - sha256: be237134ab215d4a1591307f6286f4aa53ed5a492c2ee56be5d86be344fd16db - url: "https://pub.flutter-io.cn" + sha256: b015021e7b19107ebf06277531d48fa40e450a500bad751a330ab5f94c815650 + url: "https://pub.dev" source: hosted - version: "4.7.0" + version: "4.7.4" flutter: dependency: "direct main" description: flutter @@ -323,17 +323,17 @@ packages: description: name: flutter_launcher_icons sha256: "526faf84284b86a4cb36d20a5e45147747b7563d921373d4ee0559c54fcdbcea" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "0.13.1" flutter_lints: dependency: "direct dev" description: name: flutter_lints - sha256: "2118df84ef0c3ca93f96123a616ae8540879991b8b57af2f81b76a7ada49b2a4" - url: "https://pub.flutter-io.cn" + sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04 + url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.0.3" flutter_localizations: dependency: "direct main" description: flutter @@ -343,10 +343,10 @@ packages: dependency: transitive description: name: flutter_plugin_android_lifecycle - sha256: "950e77c2bbe1692bc0874fc7fb491b96a4dc340457f4ea1641443d0a6c1ea360" - url: "https://pub.flutter-io.cn" + sha256: f185ac890306b5779ecbd611f52502d8d4d63d27703ef73161ca0407e815f02c + url: "https://pub.dev" source: hosted - version: "2.0.15" + version: "2.0.16" flutter_test: dependency: "direct dev" description: flutter @@ -362,23 +362,23 @@ packages: description: name: frontend_server_client sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "3.2.0" get: dependency: "direct main" description: name: get - sha256: "2ba20a47c8f1f233bed775ba2dd0d3ac97b4cf32fc17731b3dfc672b06b0e92a" - url: "https://pub.flutter-io.cn" + sha256: e4e7335ede17452b391ed3b2ede016545706c01a02292a6c97619705e7d2a85e + url: "https://pub.dev" source: hosted - version: "4.6.5" + version: "4.6.6" glob: dependency: transitive description: name: glob sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.1.2" graphs: @@ -386,7 +386,7 @@ packages: description: name: graphs sha256: aedc5a15e78fc65a6e23bcd927f24c64dd995062bcd1ca6eda65a3cff92a4d19 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.3.1" http: @@ -394,7 +394,7 @@ packages: description: name: http sha256: "759d1a329847dd0f39226c688d3e06a6b8679668e350e2891a6474f8b4bb8525" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.1.0" http_multi_server: @@ -402,7 +402,7 @@ packages: description: name: http_multi_server sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "3.2.1" http_parser: @@ -410,7 +410,7 @@ packages: description: name: http_parser sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "4.0.2" image: @@ -418,31 +418,55 @@ packages: description: name: image sha256: a72242c9a0ffb65d03de1b7113bc4e189686fc07c7147b8b41811d0dd0e0d9bf - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "4.0.17" intl: dependency: transitive description: name: intl - sha256: a3715e3bc90294e971cb7dc063fbf3cd9ee0ebf8604ffeafabd9e6f16abbdbe6 - url: "https://pub.flutter-io.cn" + sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" + url: "https://pub.dev" source: hosted - version: "0.18.0" + version: "0.18.1" io: dependency: transitive description: name: io sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.0.4" + isar: + dependency: "direct main" + description: + name: isar + sha256: "99165dadb2cf2329d3140198363a7e7bff9bbd441871898a87e26914d25cf1ea" + url: "https://pub.dev" + source: hosted + version: "3.1.0+1" + isar_flutter_libs: + dependency: "direct main" + description: + name: isar_flutter_libs + sha256: bc6768cc4b9c61aabff77152e7f33b4b17d2fc93134f7af1c3dd51500fe8d5e8 + url: "https://pub.dev" + source: hosted + version: "3.1.0+1" + isar_generator: + dependency: "direct dev" + description: + name: isar_generator + sha256: "76c121e1295a30423604f2f819bc255bc79f852f3bc8743a24017df6068ad133" + url: "https://pub.dev" + source: hosted + version: "3.1.0+1" js: dependency: transitive description: name: js sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "0.6.7" json_annotation: @@ -450,7 +474,7 @@ packages: description: name: json_annotation sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "4.8.1" json_serializable: @@ -458,7 +482,7 @@ packages: description: name: json_serializable sha256: aa1f5a8912615733e0fdc7a02af03308933c93235bdc8d50d0b0c8a8ccb0b969 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "6.7.1" lint: @@ -466,7 +490,7 @@ packages: description: name: lint sha256: "4a539aa34ec5721a2c7574ae2ca0336738ea4adc2a34887d54b7596310b33c85" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.10.0" lints: @@ -474,7 +498,7 @@ packages: description: name: lints sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.1.1" logger: @@ -482,7 +506,7 @@ packages: description: name: logger sha256: "7ad7215c15420a102ec687bb320a7312afd449bac63bfb1c60d9787c27b9767f" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.4.0" logging: @@ -490,23 +514,23 @@ packages: description: name: logging sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.2.0" logging_appenders: dependency: transitive description: name: logging_appenders - sha256: "69e6f077fa0f416dbb0d926fdb066dd686245ac5bd36e8fefce6ee4783d3c766" - url: "https://pub.flutter-io.cn" + sha256: "1fb8a008c04246f4677a0d034d69779a5975e56e02573a5162240239b247e239" + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.0+1" lottie: dependency: "direct main" description: name: lottie sha256: "893da7a0022ec2fcaa616f34529a081f617e86cc501105b856e5a3184c58c7c2" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.4.3" macos_secure_bookmarks: @@ -514,31 +538,31 @@ packages: description: name: macos_secure_bookmarks sha256: c3163875f8fd530a1654a7cf8aa426e6e208d28bf05724a1d4960e4b7d2ca1c6 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "0.2.1" matcher: dependency: transitive description: name: matcher - sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" - url: "https://pub.flutter-io.cn" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + url: "https://pub.dev" source: hosted - version: "0.12.15" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 - url: "https://pub.flutter-io.cn" + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.5.0" math_expressions: dependency: transitive description: name: math_expressions sha256: "3576593617c3870d75728a751f6ec6e606706d44e363f088ac394b5a28a98064" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.4.0" menu_base: @@ -546,7 +570,7 @@ packages: description: name: menu_base sha256: "820368014a171bd1241030278e6c2617354f492f5c703d7b7d4570a6b8b84405" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "0.1.1" meta: @@ -554,7 +578,7 @@ packages: description: name: meta sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.9.1" mime: @@ -562,7 +586,7 @@ packages: description: name: mime sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.0.4" open_file: @@ -570,7 +594,7 @@ packages: description: name: open_file sha256: a5a32d44acb7c899987d0999e1e3cbb0a0f1adebbf41ac813ec6d2d8faa0af20 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "3.3.2" package_config: @@ -578,23 +602,23 @@ packages: description: name: package_config sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.1.0" package_info_plus: dependency: "direct main" description: name: package_info_plus - sha256: ceb027f6bc6a60674a233b4a90a7658af1aebdea833da0b5b53c1e9821a78c7b - url: "https://pub.flutter-io.cn" + sha256: "6ff267fcd9d48cb61c8df74a82680e8b82e940231bb5f68356672fde0397334a" + url: "https://pub.dev" source: hosted - version: "4.0.2" + version: "4.1.0" package_info_plus_platform_interface: dependency: transitive description: name: package_info_plus_platform_interface sha256: "9bc8ba46813a4cc42c66ab781470711781940780fd8beddd0c3da62506d3a6c6" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.0.1" path: @@ -602,87 +626,87 @@ packages: description: name: path sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.8.3" path_provider: dependency: "direct main" description: name: path_provider - sha256: "3087813781ab814e4157b172f1a11c46be20179fcc9bea043e0fba36bc0acaa2" - url: "https://pub.flutter-io.cn" + sha256: a1aa8aaa2542a6bc57e381f132af822420216c80d4781f7aa085ca3229208aaa + url: "https://pub.dev" source: hosted - version: "2.0.15" + version: "2.1.1" path_provider_android: dependency: transitive description: name: path_provider_android - sha256: "2cec049d282c7f13c594b4a73976b0b4f2d7a1838a6dd5aaf7bd9719196bee86" - url: "https://pub.flutter-io.cn" + sha256: "6b8b19bd80da4f11ce91b2d1fb931f3006911477cec227cce23d3253d80df3f1" + url: "https://pub.dev" source: hosted - version: "2.0.27" + version: "2.2.0" path_provider_foundation: dependency: transitive description: name: path_provider_foundation - sha256: "1995d88ec2948dac43edf8fe58eb434d35d22a2940ecee1a9fefcd62beee6eb3" - url: "https://pub.flutter-io.cn" + sha256: "19314d595120f82aca0ba62787d58dde2cc6b5df7d2f0daf72489e38d1b57f2d" + url: "https://pub.dev" source: hosted - version: "2.2.3" + version: "2.3.1" path_provider_linux: dependency: transitive description: name: path_provider_linux - sha256: ffbb8cc9ed2c9ec0e4b7a541e56fd79b138e8f47d2fb86815f15358a349b3b57 - url: "https://pub.flutter-io.cn" + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 + url: "https://pub.dev" source: hosted - version: "2.1.11" + version: "2.2.1" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface - sha256: "57585299a729335f1298b43245842678cb9f43a6310351b18fb577d6e33165ec" - url: "https://pub.flutter-io.cn" + sha256: "94b1e0dd80970c1ce43d5d4e050a9918fce4f4a775e6142424c30a29a363265c" + url: "https://pub.dev" source: hosted - version: "2.0.6" + version: "2.1.1" path_provider_windows: dependency: transitive description: name: path_provider_windows - sha256: "1cb68ba4cd3a795033de62ba1b7b4564dace301f952de6bfb3cd91b202b6ee96" - url: "https://pub.flutter-io.cn" + sha256: "8bc9f22eee8690981c22aa7fc602f5c85b497a6fb2ceb35ee5a5e5ed85ad8170" + url: "https://pub.dev" source: hosted - version: "2.1.7" + version: "2.2.1" petitparser: dependency: transitive description: name: petitparser sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "5.4.0" platform: dependency: transitive description: name: platform - sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" - url: "https://pub.flutter-io.cn" + sha256: ae68c7bfcd7383af3629daafb32fb4e8681c7154428da4febcff06200585f102 + url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.1.2" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - sha256: "6a2128648c854906c53fa8e33986fc0247a1116122f9534dd20e3ab9e16a32bc" - url: "https://pub.flutter-io.cn" + sha256: da3fdfeccc4d4ff2da8f8c556704c08f912542c5fb3cf2233ed75372384a034d + url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.1.6" pointycastle: dependency: transitive description: name: pointycastle sha256: "7c1e5f0d23c9016c5bbd8b1473d0d3fb3fc851b876046039509e18e0c7485f2c" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "3.7.3" pool: @@ -690,23 +714,15 @@ packages: description: name: pool sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.5.1" - process: - dependency: transitive - description: - name: process - sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09" - url: "https://pub.flutter-io.cn" - source: hosted - version: "4.2.4" pub_semver: dependency: transitive description: name: pub_semver sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.1.4" pubspec_parse: @@ -714,7 +730,7 @@ packages: description: name: pubspec_parse sha256: c63b2876e58e194e4b0828fcb080ad0e06d051cb607a6be51a9e084f47cb9367 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.2.3" quiver: @@ -722,7 +738,7 @@ packages: description: name: quiver sha256: b1c1ac5ce6688d77f65f3375a9abb9319b3cb32486bdc7a1e0fdf004d7ba4e47 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "3.2.1" recase: @@ -730,7 +746,7 @@ packages: description: name: recase sha256: e4eb4ec2dcdee52dcf99cb4ceabaffc631d7424ee55e56f280bc039737f89213 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "4.1.0" rounded_loading_button: @@ -738,7 +754,7 @@ packages: description: name: rounded_loading_button sha256: ec4af194330ba688527749059b7c1a3d1ddda6c18794ec4b0696f0cb3b9784ff - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.1.0" rxdart: @@ -746,23 +762,23 @@ packages: description: name: rxdart sha256: "0c7c0cedd93788d996e33041ffecda924cc54389199cde4e6a34b440f50044cb" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "0.27.7" screen_retriever: dependency: transitive description: name: screen_retriever - sha256: "4931f226ca158123ccd765325e9fbf360bfed0af9b460a10f960f9bb13d58323" - url: "https://pub.flutter-io.cn" + sha256: "6ee02c8a1158e6dae7ca430da79436e3b1c9563c8cf02f524af997c201ac2b90" + url: "https://pub.dev" source: hosted - version: "0.1.6" + version: "0.1.9" scroll_pos: dependency: transitive description: name: scroll_pos sha256: "4246bff3afc779d87cdf650a67d42d67ae71b23ff020d14592e6b89e28a7f9cc" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "0.4.0" share_plus: @@ -770,7 +786,7 @@ packages: description: name: share_plus sha256: "6cec740fa0943a826951223e76218df002804adb588235a8910dc3d6b0654e11" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "7.1.0" share_plus_platform_interface: @@ -778,71 +794,71 @@ packages: description: name: share_plus_platform_interface sha256: "357412af4178d8e11d14f41723f80f12caea54cf0d5cd29af9dcdab85d58aea7" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "3.3.0" shared_preferences: dependency: "direct main" description: name: shared_preferences - sha256: "0344316c947ffeb3a529eac929e1978fcd37c26be4e8468628bac399365a3ca1" - url: "https://pub.flutter-io.cn" + sha256: b7f41bad7e521d205998772545de63ff4e6c97714775902c199353f8bf1511ac + url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.2.1" shared_preferences_android: dependency: transitive description: name: shared_preferences_android - sha256: fe8401ec5b6dcd739a0fe9588802069e608c3fdbfd3c3c93e546cf2f90438076 - url: "https://pub.flutter-io.cn" + sha256: "8568a389334b6e83415b6aae55378e158fbc2314e074983362d20c562780fb06" + url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.2.1" shared_preferences_foundation: dependency: transitive description: name: shared_preferences_foundation - sha256: b046999bf0ff58f04c364491bb803dcfa8f42e47b19c75478f53d323684a8cc1 - url: "https://pub.flutter-io.cn" + sha256: "7bf53a9f2d007329ee6f3df7268fd498f8373602f943c975598bbb34649b62a7" + url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.3.4" shared_preferences_linux: dependency: transitive description: name: shared_preferences_linux - sha256: "71d6806d1449b0a9d4e85e0c7a917771e672a3d5dc61149cc9fac871115018e1" - url: "https://pub.flutter-io.cn" + sha256: c2eb5bf57a2fe9ad6988121609e47d3e07bb3bdca5b6f8444e4cf302428a128a + url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "2.3.1" shared_preferences_platform_interface: dependency: transitive description: name: shared_preferences_platform_interface - sha256: "23b052f17a25b90ff2b61aad4cc962154da76fb62848a9ce088efe30d7c50ab1" - url: "https://pub.flutter-io.cn" + sha256: d4ec5fc9ebb2f2e056c617112aa75dcf92fc2e4faaf2ae999caa297473f75d8a + url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "2.3.1" shared_preferences_web: dependency: transitive description: name: shared_preferences_web - sha256: "7347b194fb0bbeb4058e6a4e87ee70350b6b2b90f8ac5f8bd5b3a01548f6d33a" - url: "https://pub.flutter-io.cn" + sha256: d762709c2bbe80626ecc819143013cc820fa49ca5e363620ee20a8b15a3e3daf + url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.2.1" shared_preferences_windows: dependency: transitive description: name: shared_preferences_windows - sha256: f95e6a43162bce43c9c3405f3eb6f39e5b5d11f65fab19196cf8225e2777624d - url: "https://pub.flutter-io.cn" + sha256: f763a101313bd3be87edffe0560037500967de9c394a714cd598d945517f694f + url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "2.3.1" shelf: dependency: transitive description: name: shelf sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.4.1" shelf_web_socket: @@ -850,7 +866,7 @@ packages: description: name: shelf_web_socket sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.0.4" shortid: @@ -858,7 +874,7 @@ packages: description: name: shortid sha256: d0b40e3dbb50497dad107e19c54ca7de0d1a274eb9b4404991e443dadb9ebedb - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "0.1.2" sky_engine: @@ -871,7 +887,7 @@ packages: description: name: source_gen sha256: fc0da689e5302edb6177fdd964efcb7f58912f43c28c2047a808f5bfff643d16 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.4.0" source_helper: @@ -879,23 +895,23 @@ packages: description: name: source_helper sha256: "6adebc0006c37dd63fe05bca0a929b99f06402fc95aa35bf36d67f5c06de01fd" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.3.4" source_span: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 - url: "https://pub.flutter-io.cn" + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" stack_trace: dependency: transitive description: name: stack_trace sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.11.0" stream_channel: @@ -903,7 +919,7 @@ packages: description: name: stream_channel sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.1.1" stream_transform: @@ -911,7 +927,7 @@ packages: description: name: stream_transform sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.1.0" string_scanner: @@ -919,7 +935,7 @@ packages: description: name: string_scanner sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.2.0" styled_widget: @@ -927,7 +943,7 @@ packages: description: name: styled_widget sha256: "4d439802919b6ccf10d1488798656da8804633b03012682dd1c8ca70a084aa84" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "0.4.1" term_glyph: @@ -935,23 +951,31 @@ packages: description: name: term_glyph sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.2.1" test_api: dependency: transitive description: name: test_api - sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb - url: "https://pub.flutter-io.cn" + sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + url: "https://pub.dev" + source: hosted + version: "0.6.0" + time: + dependency: transitive + description: + name: time + sha256: "83427e11d9072e038364a5e4da559e85869b227cf699a541be0da74f14140124" + url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "2.1.3" timing: dependency: transitive description: name: timing sha256: "70a3b636575d4163c477e6de42f247a23b315ae20e86442bebe32d3cabf61c32" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.0.1" tray_manager: @@ -959,7 +983,7 @@ packages: description: name: tray_manager sha256: b1975a05e0c6999e983cf9a58a6a098318c896040ccebac5398a3cc9e43b9c69 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "0.2.0" typed_data: @@ -967,7 +991,7 @@ packages: description: name: typed_data sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.3.2" uri_to_file: @@ -975,79 +999,79 @@ packages: description: name: uri_to_file sha256: "84afd633b1492fc465c768141e1a29edd519061bf99935b6b4d0d5de8ec7c108" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "0.2.0" url_launcher: dependency: "direct main" description: name: url_launcher - sha256: "781bd58a1eb16069412365c98597726cd8810ae27435f04b3b4d3a470bacd61e" - url: "https://pub.flutter-io.cn" + sha256: "47e208a6711459d813ba18af120d9663c20bdf6985d6ad39fe165d2538378d27" + url: "https://pub.dev" source: hosted - version: "6.1.12" + version: "6.1.14" url_launcher_android: dependency: transitive description: name: url_launcher_android - sha256: "15f5acbf0dce90146a0f5a2c4a002b1814a6303c4c5c075aa2623b2d16156f03" - url: "https://pub.flutter-io.cn" + sha256: b04af59516ab45762b2ca6da40fa830d72d0f6045cd97744450b73493fa76330 + url: "https://pub.dev" source: hosted - version: "6.0.36" + version: "6.1.0" url_launcher_ios: dependency: transitive description: name: url_launcher_ios - sha256: "9af7ea73259886b92199f9e42c116072f05ff9bea2dcb339ab935dfc957392c2" - url: "https://pub.flutter-io.cn" + sha256: "7c65021d5dee51813d652357bc65b8dd4a6177082a9966bc8ba6ee477baa795f" + url: "https://pub.dev" source: hosted - version: "6.1.4" + version: "6.1.5" url_launcher_linux: dependency: transitive description: name: url_launcher_linux - sha256: "207f4ddda99b95b4d4868320a352d374b0b7e05eefad95a4a26f57da413443f5" - url: "https://pub.flutter-io.cn" + sha256: b651aad005e0cb06a01dbd84b428a301916dc75f0e7ea6165f80057fee2d8e8e + url: "https://pub.dev" source: hosted - version: "3.0.5" + version: "3.0.6" url_launcher_macos: dependency: transitive description: name: url_launcher_macos - sha256: "91ee3e75ea9dadf38036200c5d3743518f4a5eb77a8d13fda1ee5764373f185e" - url: "https://pub.flutter-io.cn" + sha256: b55486791f666e62e0e8ff825e58a023fd6b1f71c49926483f1128d3bbd8fe88 + url: "https://pub.dev" source: hosted - version: "3.0.5" + version: "3.0.7" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface - sha256: bfdfa402f1f3298637d71ca8ecfe840b4696698213d5346e9d12d4ab647ee2ea - url: "https://pub.flutter-io.cn" + sha256: "95465b39f83bfe95fcb9d174829d6476216f2d548b79c38ab2506e0458787618" + url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "2.1.5" url_launcher_web: dependency: transitive description: name: url_launcher_web - sha256: cc26720eefe98c1b71d85f9dc7ef0cada5132617046369d9dc296b3ecaa5cbb4 - url: "https://pub.flutter-io.cn" + sha256: "2942294a500b4fa0b918685aff406773ba0a4cd34b7f42198742a94083020ce5" + url: "https://pub.dev" source: hosted - version: "2.0.18" + version: "2.0.20" url_launcher_windows: dependency: transitive description: name: url_launcher_windows - sha256: "7967065dd2b5fccc18c653b97958fdf839c5478c28e767c61ee879f4e7882422" - url: "https://pub.flutter-io.cn" + sha256: "95fef3129dc7cfaba2bc3d5ba2e16063bb561fc6d78e63eee16162bc70029069" + url: "https://pub.dev" source: hosted - version: "3.0.7" + version: "3.0.8" uuid: dependency: transitive description: name: uuid sha256: "648e103079f7c64a36dc7d39369cabb358d377078a051d6ae2ad3aa539519313" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "3.0.7" vector_math: @@ -1055,7 +1079,7 @@ packages: description: name: vector_math sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.1.4" watcher: @@ -1063,15 +1087,23 @@ packages: description: name: watcher sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.1.0" + 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: name: web_socket_channel sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.4.0" win32: @@ -1079,39 +1111,47 @@ packages: description: name: win32 sha256: "5a751eddf9db89b3e5f9d50c20ab8612296e4e8db69009788d6c8b060a84191c" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "4.1.4" window_manager: dependency: "direct main" description: name: window_manager - sha256: "9eef00e393e7f9308309ce9a8b2398c9ee3ca78b50c96e8b4f9873945693ac88" - url: "https://pub.flutter-io.cn" + sha256: "6ee795be9124f90660ea9d05e581a466de19e1c89ee74fc4bf528f60c8600edd" + url: "https://pub.dev" source: hosted - version: "0.3.5" + version: "0.3.6" xdg_directories: dependency: transitive description: name: xdg_directories - sha256: ee1505df1426458f7f60aac270645098d318a8b4766d85fde75f76f2e21807d1 - url: "https://pub.flutter-io.cn" + sha256: "589ada45ba9e39405c198fe34eb0f607cddb2108527e658136120892beac46d2" + url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.0.3" xml: dependency: transitive description: name: xml sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "6.3.0" + xxh3: + dependency: transitive + description: + name: xxh3 + sha256: a92b30944a9aeb4e3d4f3c3d4ddb3c7816ca73475cd603682c4f8149690f56d7 + url: "https://pub.dev" + source: hosted + version: "1.0.1" yaml: dependency: transitive description: name: yaml sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "3.1.2" yaml_edit: @@ -1119,9 +1159,9 @@ packages: description: name: yaml_edit sha256: "1579d4a0340a83cf9e4d580ea51a16329c916973bffd5bd4b45e911b25d46bfd" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.1.1" sdks: - dart: ">=3.0.0 <3.2.0" - flutter: ">=3.10.0" + dart: ">=3.1.0 <4.0.0" + flutter: ">=3.13.0" From c0ce5fbad3a42af09413bdffc56c1cf270b64cb9 Mon Sep 17 00:00:00 2001 From: Om Jogani Date: Thu, 19 Oct 2023 16:17:42 +0530 Subject: [PATCH 4/7] [Add]: Pubspec.lock file --- ui/flutter/pubspec.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/flutter/pubspec.lock b/ui/flutter/pubspec.lock index 032c28fbd..425da25f5 100644 --- a/ui/flutter/pubspec.lock +++ b/ui/flutter/pubspec.lock @@ -323,7 +323,7 @@ packages: description: name: flutter_form_builder sha256: "8973beed34b6d951d36bf688b52e9e3040b47b763c35c320bd6f4c2f6b13f3a2" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "9.1.1" flutter_launcher_icons: @@ -369,10 +369,10 @@ packages: dependency: "direct main" description: name: form_builder_validators - sha256: e04998b1597d76a51da7f009ed3b2f12d4173f13e146e8744fd2453e8595a2c9 - url: "https://pub.flutter-io.cn" + sha256: "19aa5282b7cede82d0025ab031a98d0554b84aa2ba40f12013471a3b3e22bf02" + url: "https://pub.dev" source: hosted - version: "9.0.0" + version: "9.1.0" frontend_server_client: dependency: transitive description: From 8747f8b63c950ce6e7d37c422efaa74df62a5656 Mon Sep 17 00:00:00 2001 From: Om Jogani Date: Fri, 20 Oct 2023 15:58:21 +0530 Subject: [PATCH 5/7] [Add, Update]: Final Touch Up --- .../app/modules/create/views/create_view.dart | 321 +++++++++++------- .../controller/history_controller.dart | 2 +- .../modules/history/views/history_view.dart | 109 +++--- 3 files changed, 270 insertions(+), 162 deletions(-) diff --git a/ui/flutter/lib/app/modules/create/views/create_view.dart b/ui/flutter/lib/app/modules/create/views/create_view.dart index a98382b90..555b5015c 100644 --- a/ui/flutter/lib/app/modules/create/views/create_view.dart +++ b/ui/flutter/lib/app/modules/create/views/create_view.dart @@ -4,6 +4,9 @@ import 'package:file_picker/file_picker.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:get/get.dart'; +import 'package:gopeed/api/model/history_data.dart'; +import 'package:gopeed/app/modules/history/controller/history_controller.dart'; +import 'package:gopeed/app/modules/history/views/history_view.dart'; import 'package:path/path.dart' as path; import 'package:rounded_loading_button/rounded_loading_button.dart'; @@ -31,6 +34,7 @@ class CreateView extends GetView { final _httpCookieController = TextEditingController(); final _httpRefererController = TextEditingController(); final _btTrackerController = TextEditingController(); + final _historyController = HistoryController(); final _availableSchemes = ["http:", "https:", "magnet:"]; @@ -90,121 +94,198 @@ class CreateView extends GetView { FocusScope.of(context).requestFocus(FocusNode()); }, child: Padding( - padding: - const EdgeInsets.symmetric(vertical: 16.0, horizontal: 24.0), - child: Form( - key: _resolveFormKey, - autovalidateMode: AutovalidateMode.onUserInteraction, - child: Column(children: [ - Row(children: [ - Expanded( - child: TextFormField( - autofocus: true, - controller: _urlController, - minLines: 1, - maxLines: 5, - decoration: InputDecoration( - hintText: _hitText(), - hintStyle: const TextStyle(fontSize: 12), - labelText: 'downloadLink'.tr, - icon: const Icon(Icons.link), - suffixIcon: IconButton( - onPressed: () { - _urlController.clear(); - controller.clearFileDataUri(); - }, - icon: const Icon(Icons.clear), - ), + padding: + const EdgeInsets.symmetric(vertical: 16.0, horizontal: 24.0), + child: Form( + key: _resolveFormKey, + autovalidateMode: AutovalidateMode.onUserInteraction, + child: Column( + children: [ + Row(children: [ + Expanded( + child: TextFormField( + autofocus: true, + controller: _urlController, + minLines: 1, + maxLines: 5, + decoration: InputDecoration( + hintText: _hitText(), + hintStyle: const TextStyle(fontSize: 12), + labelText: 'downloadLink'.tr, + icon: const Icon(Icons.link), + suffixIcon: IconButton( + onPressed: () { + _urlController.clear(); + controller.clearFileDataUri(); + }, + icon: const Icon(Icons.clear), ), - validator: (v) { - return v!.trim().isNotEmpty - ? null - : 'downloadLinkValid'.tr; - }, - onChanged: (v) async { - controller.clearFileDataUri(); - if (controller.oldUrl.value.isEmpty) { - recognizeMagnetUri(v); - } - controller.oldUrl.value = v; - }, ), + validator: (v) { + return v!.trim().isNotEmpty + ? null + : 'downloadLinkValid'.tr; + }, + onChanged: (v) async { + controller.clearFileDataUri(); + if (controller.oldUrl.value.isEmpty) { + recognizeMagnetUri(v); + } + controller.oldUrl.value = v; + }, ), - IconButton( - icon: const Icon(Icons.folder_open), - onPressed: () async { - var pr = await FilePicker.platform.pickFiles( - type: FileType.custom, - allowedExtensions: ["torrent"]); - if (pr != null) { - if (!Util.isWeb()) { - _urlController.text = pr.files[0].path ?? ""; - return; - } - _urlController.text = pr.files[0].name; - controller.setFileDataUri(pr.files[0].bytes!); - } - }), - ] - //.where((e) => e != null).map((e) => e!).toList(), - ), - Obx(() => Visibility( - visible: controller.showAdvanced.value, - child: Padding( - padding: const EdgeInsets.only(left: 40, top: 15), - child: Column( - children: [ - TabBar( - controller: controller.advancedTabController, - tabs: const [ - Tab( - text: 'HTTP', - ), - Tab( - text: 'BitTorrent', - ) - ], - ), - AutoScaleTabBarView( - controller: controller.advancedTabController, - children: [ - Column( - children: [ - TextFormField( - controller: _httpUaController, - decoration: const InputDecoration( - labelText: 'User-Agent', - )), - TextFormField( - controller: _httpCookieController, - decoration: const InputDecoration( - labelText: 'Cookie', - )), - TextFormField( - controller: _httpRefererController, - decoration: const InputDecoration( - labelText: 'Referer', - )), - ], + ), + IconButton( + icon: const Icon(Icons.folder_open), + onPressed: () async { + var pr = await FilePicker.platform.pickFiles( + type: FileType.custom, + allowedExtensions: ["torrent"]); + if (pr != null) { + if (!Util.isWeb()) { + _urlController.text = pr.files[0].path ?? ""; + return; + } + _urlController.text = pr.files[0].name; + controller.setFileDataUri(pr.files[0].bytes!); + } + }, + ), + IconButton( + icon: const Icon(Icons.history_rounded), + onPressed: () async { + List resultOfHistories = + await _historyController.getAllHistory(); + // show dialog box to list history + if (context.mounted) { + showGeneralDialog( + barrierColor: Colors.black.withOpacity(0.5), + transitionBuilder: (context, a1, a2, widget) { + return Transform.scale( + scale: a1.value, + child: Opacity( + opacity: a1.value, + child: HistoryView( + isHistoryListEmpty: + resultOfHistories.isEmpty, + historyList: ListView.builder( + itemCount: resultOfHistories.length, + itemBuilder: (context, index) { + return GestureDetector( + onTap: () { + _urlController.text = + resultOfHistories[index].text!; + Navigator.pop(context); + }, + child: MouseRegion( + cursor: SystemMouseCursors.click, + child: Container( + padding: + const EdgeInsets.symmetric( + horizontal: 8.0, + vertical: 8.0, + ), + margin: + const EdgeInsets.symmetric( + horizontal: 10.0, + vertical: 8.0, + ), + decoration: BoxDecoration( + color: Theme.of(context) + .colorScheme + .background, + borderRadius: + BorderRadius.circular(10.0), + ), + child: Text( + resultOfHistories[index] + .text + .toString(), + ), + ), + ), + ); + }, + ), ), - Column( - children: [ - TextFormField( - controller: _btTrackerController, - maxLines: 5, - decoration: InputDecoration( - labelText: 'Trakers', - hintText: 'addTrackerHit'.tr, - )), - ], - ) - ], - ) - ], - ), - ))), - Center( - child: Padding( + ), + ); + }, + transitionDuration: + const Duration(milliseconds: 250), + barrierDismissible: true, + barrierLabel: '', + context: context, + pageBuilder: (context, animation1, animation2) { + return const Text('PAGE BUILDER'); + }, + ); + } + }, + ), + ] + //.where((e) => e != null).map((e) => e!).toList(), + ), + Obx( + () => Visibility( + visible: controller.showAdvanced.value, + child: Padding( + padding: const EdgeInsets.only(left: 40, top: 15), + child: Column( + children: [ + TabBar( + controller: controller.advancedTabController, + tabs: const [ + Tab( + text: 'HTTP', + ), + Tab( + text: 'BitTorrent', + ) + ], + ), + AutoScaleTabBarView( + controller: controller.advancedTabController, + children: [ + Column( + children: [ + TextFormField( + controller: _httpUaController, + decoration: const InputDecoration( + labelText: 'User-Agent', + )), + TextFormField( + controller: _httpCookieController, + decoration: const InputDecoration( + labelText: 'Cookie', + )), + TextFormField( + controller: _httpRefererController, + decoration: const InputDecoration( + labelText: 'Referer', + )), + ], + ), + Column( + children: [ + TextFormField( + controller: _btTrackerController, + maxLines: 5, + decoration: InputDecoration( + labelText: 'Trakers', + hintText: 'addTrackerHit'.tr, + )), + ], + ) + ], + ) + ], + ), + ), + ), + ), + Center( + child: Padding( padding: const EdgeInsets.only(top: 15), child: Column( children: [ @@ -240,8 +321,12 @@ class CreateView extends GetView { ), ], ), - )), - ]))), + ), + ), + ], + ), + ), + ), ), ), ); @@ -272,9 +357,9 @@ class CreateView extends GetView { // check if is multi line urls final urls = Util.textToLines(_urlController.text); ResolveResult rr; - bool isMuiltiLine = false; + bool isMultiLine = false; if (urls.length > 1) { - isMuiltiLine = true; + isMultiLine = true; rr = ResolveResult( res: Resource( files: urls @@ -286,12 +371,16 @@ class CreateView extends GetView { final submitUrl = Util.isWeb() && controller.fileDataUri.isNotEmpty ? controller.fileDataUri.value : _urlController.text; + // add final submitUrl to the history + HistoryData history = HistoryData(); + history.text = submitUrl; + _historyController.addHistory(history); rr = await resolve(Request( url: submitUrl, extra: parseReqExtra(_urlController.text), )); } - await _showResolveDialog(rr, isMuiltiLine); + await _showResolveDialog(rr, isMultiLine); } } catch (e) { showErrorMessage(e); diff --git a/ui/flutter/lib/app/modules/history/controller/history_controller.dart b/ui/flutter/lib/app/modules/history/controller/history_controller.dart index d5e05a806..469c458cc 100644 --- a/ui/flutter/lib/app/modules/history/controller/history_controller.dart +++ b/ui/flutter/lib/app/modules/history/controller/history_controller.dart @@ -24,7 +24,7 @@ class HistoryController { ); await isar.writeTxn(() async { - await isar.historyDatas.put(data); + await isar.historyDatas.put(data); }); await isar.close(); } diff --git a/ui/flutter/lib/app/modules/history/views/history_view.dart b/ui/flutter/lib/app/modules/history/views/history_view.dart index 259074e7f..59291d806 100644 --- a/ui/flutter/lib/app/modules/history/views/history_view.dart +++ b/ui/flutter/lib/app/modules/history/views/history_view.dart @@ -1,30 +1,20 @@ import 'package:flutter/material.dart'; -import 'package:gopeed/api/model/history_data.dart'; -import 'package:gopeed/app/modules/history/controller/history_controller.dart'; class HistoryView extends StatefulWidget { - const HistoryView({super.key}); + const HistoryView({ + super.key, + required this.isHistoryListEmpty, + required this.historyList, + }); + + final bool isHistoryListEmpty; + final Widget historyList; @override State createState() => _HistoryViewState(); } class _HistoryViewState extends State { - List listOfHistoryData = []; - HistoryController _controller = HistoryController(); - @override - void initState() { - super.initState(); - getAllHistory(); - } - - void getAllHistory() async { - List resultOfHistories = await _controller.getAllHistory(); - setState(() { - listOfHistoryData = resultOfHistories; - }); - } - @override Widget build(BuildContext context) { final Size size = MediaQuery.sizeOf(context); @@ -38,37 +28,66 @@ class _HistoryViewState extends State { width: size.width * 0.8, height: size.height * 0.8, decoration: BoxDecoration( + color: Theme.of(context).colorScheme.surface, borderRadius: BorderRadius.circular(10.0), ), - child: Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: listOfHistoryData.isEmpty - ? const [ - Icon( - Icons.manage_history_rounded, - ), - SizedBox( - height: 10.0, - ), - Text( - "No History Found", - ), - ] - : [ - Expanded( - child: ListView.builder( - itemBuilder: (context, index) { - return ListTile( - title: Text( - listOfHistoryData[index].text.toString(), - ), - ); - }, + child: Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Icon( + Icons.history_rounded, + size: Theme.of(context) + .textTheme + .headlineSmall + ?.fontSize, + ), + const SizedBox(width: 8.0), + Text( + "History", + style: Theme.of(context).textTheme.headlineSmall, ), + ], + ), + IconButton( + onPressed: () => Navigator.pop(context), + icon: const Icon( + Icons.close_rounded, ), - ], - ), + ), + ], + ), + ), + Expanded( + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: widget.isHistoryListEmpty + ? const [ + Icon( + Icons.manage_history_rounded, + ), + SizedBox( + height: 10.0, + ), + Text( + "No History Found", + ), + ] + : [ + Expanded(child: widget.historyList), + ], + ), + ), + ), + ], ), ), ), From 24c8c4194b0a3eed87291022491021b18a28d620 Mon Sep 17 00:00:00 2001 From: Om Jogani Date: Sat, 21 Oct 2023 11:13:40 +0530 Subject: [PATCH 6/7] [Migrations]: IsarDB -> shared_preferences & Added Clear History --- ui/flutter/lib/api/model/history_data.dart | 9 - ui/flutter/lib/api/model/history_data.g.dart | 456 ------------------ .../app/modules/create/views/create_view.dart | 20 +- .../controller/history_controller.dart | 43 +- .../modules/history/views/history_view.dart | 39 +- ui/flutter/pubspec.lock | 48 -- ui/flutter/pubspec.yaml | 3 - 7 files changed, 55 insertions(+), 563 deletions(-) delete mode 100644 ui/flutter/lib/api/model/history_data.dart delete mode 100644 ui/flutter/lib/api/model/history_data.g.dart diff --git a/ui/flutter/lib/api/model/history_data.dart b/ui/flutter/lib/api/model/history_data.dart deleted file mode 100644 index 9463ea33c..000000000 --- a/ui/flutter/lib/api/model/history_data.dart +++ /dev/null @@ -1,9 +0,0 @@ -import 'package:isar/isar.dart'; - -part 'history_data.g.dart'; - -@collection -class HistoryData { - Id id = Isar.autoIncrement; - String? text; -} \ No newline at end of file diff --git a/ui/flutter/lib/api/model/history_data.g.dart b/ui/flutter/lib/api/model/history_data.g.dart deleted file mode 100644 index 37aa27bc7..000000000 --- a/ui/flutter/lib/api/model/history_data.g.dart +++ /dev/null @@ -1,456 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'history_data.dart'; - -// ************************************************************************** -// IsarCollectionGenerator -// ************************************************************************** - -// coverage:ignore-file -// ignore_for_file: duplicate_ignore, non_constant_identifier_names, constant_identifier_names, invalid_use_of_protected_member, unnecessary_cast, prefer_const_constructors, lines_longer_than_80_chars, require_trailing_commas, inference_failure_on_function_invocation, unnecessary_parenthesis, unnecessary_raw_strings, unnecessary_null_checks, join_return_with_assignment, prefer_final_locals, avoid_js_rounded_ints, avoid_positional_boolean_parameters, always_specify_types - -extension GetHistoryDataCollection on Isar { - IsarCollection get historyDatas => this.collection(); -} - -const HistoryDataSchema = CollectionSchema( - name: r'HistoryData', - id: -544430032606042105, - properties: { - r'text': PropertySchema( - id: 0, - name: r'text', - type: IsarType.string, - ) - }, - estimateSize: _historyDataEstimateSize, - serialize: _historyDataSerialize, - deserialize: _historyDataDeserialize, - deserializeProp: _historyDataDeserializeProp, - idName: r'id', - indexes: {}, - links: {}, - embeddedSchemas: {}, - getId: _historyDataGetId, - getLinks: _historyDataGetLinks, - attach: _historyDataAttach, - version: '3.1.0+1', -); - -int _historyDataEstimateSize( - HistoryData object, - List offsets, - Map> allOffsets, -) { - var bytesCount = offsets.last; - { - final value = object.text; - if (value != null) { - bytesCount += 3 + value.length * 3; - } - } - return bytesCount; -} - -void _historyDataSerialize( - HistoryData object, - IsarWriter writer, - List offsets, - Map> allOffsets, -) { - writer.writeString(offsets[0], object.text); -} - -HistoryData _historyDataDeserialize( - Id id, - IsarReader reader, - List offsets, - Map> allOffsets, -) { - final object = HistoryData(); - object.id = id; - object.text = reader.readStringOrNull(offsets[0]); - return object; -} - -P _historyDataDeserializeProp

( - IsarReader reader, - int propertyId, - int offset, - Map> allOffsets, -) { - switch (propertyId) { - case 0: - return (reader.readStringOrNull(offset)) as P; - default: - throw IsarError('Unknown property with id $propertyId'); - } -} - -Id _historyDataGetId(HistoryData object) { - return object.id; -} - -List> _historyDataGetLinks(HistoryData object) { - return []; -} - -void _historyDataAttach( - IsarCollection col, Id id, HistoryData object) { - object.id = id; -} - -extension HistoryDataQueryWhereSort - on QueryBuilder { - QueryBuilder anyId() { - return QueryBuilder.apply(this, (query) { - return query.addWhereClause(const IdWhereClause.any()); - }); - } -} - -extension HistoryDataQueryWhere - on QueryBuilder { - QueryBuilder idEqualTo(Id id) { - return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: id, - upper: id, - )); - }); - } - - QueryBuilder idNotEqualTo( - Id id) { - return QueryBuilder.apply(this, (query) { - if (query.whereSort == Sort.asc) { - return query - .addWhereClause( - IdWhereClause.lessThan(upper: id, includeUpper: false), - ) - .addWhereClause( - IdWhereClause.greaterThan(lower: id, includeLower: false), - ); - } else { - return query - .addWhereClause( - IdWhereClause.greaterThan(lower: id, includeLower: false), - ) - .addWhereClause( - IdWhereClause.lessThan(upper: id, includeUpper: false), - ); - } - }); - } - - QueryBuilder idGreaterThan(Id id, - {bool include = false}) { - return QueryBuilder.apply(this, (query) { - return query.addWhereClause( - IdWhereClause.greaterThan(lower: id, includeLower: include), - ); - }); - } - - QueryBuilder idLessThan(Id id, - {bool include = false}) { - return QueryBuilder.apply(this, (query) { - return query.addWhereClause( - IdWhereClause.lessThan(upper: id, includeUpper: include), - ); - }); - } - - QueryBuilder idBetween( - Id lowerId, - Id upperId, { - bool includeLower = true, - bool includeUpper = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addWhereClause(IdWhereClause.between( - lower: lowerId, - includeLower: includeLower, - upper: upperId, - includeUpper: includeUpper, - )); - }); - } -} - -extension HistoryDataQueryFilter - on QueryBuilder { - QueryBuilder idEqualTo( - Id value) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'id', - value: value, - )); - }); - } - - QueryBuilder idGreaterThan( - Id value, { - bool include = false, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'id', - value: value, - )); - }); - } - - QueryBuilder idLessThan( - Id value, { - bool include = false, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'id', - value: value, - )); - }); - } - - QueryBuilder idBetween( - Id lower, - Id upper, { - bool includeLower = true, - bool includeUpper = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'id', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - )); - }); - } - - QueryBuilder textIsNull() { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNull( - property: r'text', - )); - }); - } - - QueryBuilder - textIsNotNull() { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(const FilterCondition.isNotNull( - property: r'text', - )); - }); - } - - QueryBuilder textEqualTo( - String? value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'text', - value: value, - caseSensitive: caseSensitive, - )); - }); - } - - QueryBuilder textGreaterThan( - String? value, { - bool include = false, - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - include: include, - property: r'text', - value: value, - caseSensitive: caseSensitive, - )); - }); - } - - QueryBuilder textLessThan( - String? value, { - bool include = false, - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.lessThan( - include: include, - property: r'text', - value: value, - caseSensitive: caseSensitive, - )); - }); - } - - QueryBuilder textBetween( - String? lower, - String? upper, { - bool includeLower = true, - bool includeUpper = true, - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.between( - property: r'text', - lower: lower, - includeLower: includeLower, - upper: upper, - includeUpper: includeUpper, - caseSensitive: caseSensitive, - )); - }); - } - - QueryBuilder textStartsWith( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.startsWith( - property: r'text', - value: value, - caseSensitive: caseSensitive, - )); - }); - } - - QueryBuilder textEndsWith( - String value, { - bool caseSensitive = true, - }) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.endsWith( - property: r'text', - value: value, - caseSensitive: caseSensitive, - )); - }); - } - - QueryBuilder textContains( - String value, - {bool caseSensitive = true}) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.contains( - property: r'text', - value: value, - caseSensitive: caseSensitive, - )); - }); - } - - QueryBuilder textMatches( - String pattern, - {bool caseSensitive = true}) { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.matches( - property: r'text', - wildcard: pattern, - caseSensitive: caseSensitive, - )); - }); - } - - QueryBuilder textIsEmpty() { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.equalTo( - property: r'text', - value: '', - )); - }); - } - - QueryBuilder - textIsNotEmpty() { - return QueryBuilder.apply(this, (query) { - return query.addFilterCondition(FilterCondition.greaterThan( - property: r'text', - value: '', - )); - }); - } -} - -extension HistoryDataQueryObject - on QueryBuilder {} - -extension HistoryDataQueryLinks - on QueryBuilder {} - -extension HistoryDataQuerySortBy - on QueryBuilder { - QueryBuilder sortByText() { - return QueryBuilder.apply(this, (query) { - return query.addSortBy(r'text', Sort.asc); - }); - } - - QueryBuilder sortByTextDesc() { - return QueryBuilder.apply(this, (query) { - return query.addSortBy(r'text', Sort.desc); - }); - } -} - -extension HistoryDataQuerySortThenBy - on QueryBuilder { - QueryBuilder thenById() { - return QueryBuilder.apply(this, (query) { - return query.addSortBy(r'id', Sort.asc); - }); - } - - QueryBuilder thenByIdDesc() { - return QueryBuilder.apply(this, (query) { - return query.addSortBy(r'id', Sort.desc); - }); - } - - QueryBuilder thenByText() { - return QueryBuilder.apply(this, (query) { - return query.addSortBy(r'text', Sort.asc); - }); - } - - QueryBuilder thenByTextDesc() { - return QueryBuilder.apply(this, (query) { - return query.addSortBy(r'text', Sort.desc); - }); - } -} - -extension HistoryDataQueryWhereDistinct - on QueryBuilder { - QueryBuilder distinctByText( - {bool caseSensitive = true}) { - return QueryBuilder.apply(this, (query) { - return query.addDistinctBy(r'text', caseSensitive: caseSensitive); - }); - } -} - -extension HistoryDataQueryProperty - on QueryBuilder { - QueryBuilder idProperty() { - return QueryBuilder.apply(this, (query) { - return query.addPropertyName(r'id'); - }); - } - - QueryBuilder textProperty() { - return QueryBuilder.apply(this, (query) { - return query.addPropertyName(r'text'); - }); - } -} diff --git a/ui/flutter/lib/app/modules/create/views/create_view.dart b/ui/flutter/lib/app/modules/create/views/create_view.dart index 555b5015c..726a7f223 100644 --- a/ui/flutter/lib/app/modules/create/views/create_view.dart +++ b/ui/flutter/lib/app/modules/create/views/create_view.dart @@ -4,11 +4,9 @@ import 'package:file_picker/file_picker.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:get/get.dart'; -import 'package:gopeed/api/model/history_data.dart'; import 'package:gopeed/app/modules/history/controller/history_controller.dart'; import 'package:gopeed/app/modules/history/views/history_view.dart'; import 'package:path/path.dart' as path; - import 'package:rounded_loading_button/rounded_loading_button.dart'; import '../../../../api/api.dart'; import '../../../../api/model/create_task.dart'; @@ -154,8 +152,11 @@ class CreateView extends GetView { IconButton( icon: const Icon(Icons.history_rounded), onPressed: () async { - List resultOfHistories = + List resultOfHistories = await _historyController.getAllHistory(); + // reversing: display last entered history first + List reverseResultOfHistories = + resultOfHistories.reversed.toList(); // show dialog box to list history if (context.mounted) { showGeneralDialog( @@ -167,14 +168,14 @@ class CreateView extends GetView { opacity: a1.value, child: HistoryView( isHistoryListEmpty: - resultOfHistories.isEmpty, + reverseResultOfHistories.isEmpty, historyList: ListView.builder( - itemCount: resultOfHistories.length, + itemCount: reverseResultOfHistories.length, itemBuilder: (context, index) { return GestureDetector( onTap: () { _urlController.text = - resultOfHistories[index].text!; + reverseResultOfHistories[index]; Navigator.pop(context); }, child: MouseRegion( @@ -198,8 +199,7 @@ class CreateView extends GetView { BorderRadius.circular(10.0), ), child: Text( - resultOfHistories[index] - .text + reverseResultOfHistories[index] .toString(), ), ), @@ -372,9 +372,7 @@ class CreateView extends GetView { ? controller.fileDataUri.value : _urlController.text; // add final submitUrl to the history - HistoryData history = HistoryData(); - history.text = submitUrl; - _historyController.addHistory(history); + _historyController.addHistory(submitUrl); rr = await resolve(Request( url: submitUrl, extra: parseReqExtra(_urlController.text), diff --git a/ui/flutter/lib/app/modules/history/controller/history_controller.dart b/ui/flutter/lib/app/modules/history/controller/history_controller.dart index 469c458cc..d76420062 100644 --- a/ui/flutter/lib/app/modules/history/controller/history_controller.dart +++ b/ui/flutter/lib/app/modules/history/controller/history_controller.dart @@ -1,31 +1,26 @@ -import 'package:gopeed/api/model/history_data.dart'; -import 'package:isar/isar.dart'; -import 'package:path_provider/path_provider.dart'; +import 'package:shared_preferences/shared_preferences.dart'; class HistoryController { - Future> getAllHistory() async { - final dir = await getApplicationDocumentsDirectory(); - - final isar = await Isar.open( - [HistoryDataSchema], - directory: dir.path, - ); - List data = await isar.historyDatas.where().findAll(); - await isar.close(); - return data; + // Get History in List + Future> getAllHistory() async { + SharedPreferences preferences = await SharedPreferences.getInstance(); + List? historyList = preferences.getStringList('history'); + if(historyList == null) { + return []; + } + return historyList; } - void addHistory(HistoryData data) async { - final dir = await getApplicationDocumentsDirectory(); - - final isar = await Isar.open( - [HistoryDataSchema], - directory: dir.path, - ); + // Get Existing History & Add New History + void addHistory(String historyText) async { + SharedPreferences preferences = await SharedPreferences.getInstance(); + List existingHistoryData = await getAllHistory(); + existingHistoryData.add(historyText); + preferences.setStringList('history', existingHistoryData); + } - await isar.writeTxn(() async { - await isar.historyDatas.put(data); - }); - await isar.close(); + void clearHistory() async { + SharedPreferences preferences = await SharedPreferences.getInstance(); + preferences.remove('history'); } } diff --git a/ui/flutter/lib/app/modules/history/views/history_view.dart b/ui/flutter/lib/app/modules/history/views/history_view.dart index 59291d806..08053658c 100644 --- a/ui/flutter/lib/app/modules/history/views/history_view.dart +++ b/ui/flutter/lib/app/modules/history/views/history_view.dart @@ -1,4 +1,6 @@ import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:gopeed/app/modules/history/controller/history_controller.dart'; class HistoryView extends StatefulWidget { const HistoryView({ @@ -51,16 +53,31 @@ class _HistoryViewState extends State { ), const SizedBox(width: 8.0), Text( - "History", + 'history'.tr, style: Theme.of(context).textTheme.headlineSmall, ), ], ), - IconButton( - onPressed: () => Navigator.pop(context), - icon: const Icon( - Icons.close_rounded, - ), + Row( + children: [ + IconButton( + onPressed: () { + HistoryController _controller = HistoryController(); + _controller.clearHistory(); + Navigator.pop(context); + }, + tooltip: "clearHistory".tr, + icon: const Icon( + Icons.history_toggle_off_rounded, + ), + ), + IconButton( + onPressed: () => Navigator.pop(context), + icon: const Icon( + Icons.close_rounded, + ), + ), + ], ), ], ), @@ -70,15 +87,13 @@ class _HistoryViewState extends State { child: Column( mainAxisAlignment: MainAxisAlignment.center, children: widget.isHistoryListEmpty - ? const [ - Icon( + ? [ + const Icon( Icons.manage_history_rounded, ), - SizedBox( - height: 10.0, - ), + const SizedBox(height: 10.0), Text( - "No History Found", + 'noHistoryFound'.tr, ), ] : [ diff --git a/ui/flutter/pubspec.lock b/ui/flutter/pubspec.lock index 425da25f5..59b633662 100644 --- a/ui/flutter/pubspec.lock +++ b/ui/flutter/pubspec.lock @@ -233,14 +233,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.3.2" - dartx: - dependency: transitive - description: - name: dartx - sha256: "8b25435617027257d43e6508b5fe061012880ddfdaa75a71d607c3de2a13d244" - url: "https://pub.dev" - source: hosted - version: "1.2.0" desktop_drop: dependency: "direct main" description: @@ -453,30 +445,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.4" - isar: - dependency: "direct main" - description: - name: isar - sha256: "99165dadb2cf2329d3140198363a7e7bff9bbd441871898a87e26914d25cf1ea" - url: "https://pub.dev" - source: hosted - version: "3.1.0+1" - isar_flutter_libs: - dependency: "direct main" - description: - name: isar_flutter_libs - sha256: bc6768cc4b9c61aabff77152e7f33b4b17d2fc93134f7af1c3dd51500fe8d5e8 - url: "https://pub.dev" - source: hosted - version: "3.1.0+1" - isar_generator: - dependency: "direct dev" - description: - name: isar_generator - sha256: "76c121e1295a30423604f2f819bc255bc79f852f3bc8743a24017df6068ad133" - url: "https://pub.dev" - source: hosted - version: "3.1.0+1" js: dependency: transitive description: @@ -978,14 +946,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.6.0" - time: - dependency: transitive - description: - name: time - sha256: "83427e11d9072e038364a5e4da559e85869b227cf699a541be0da74f14140124" - url: "https://pub.dev" - source: hosted - version: "2.1.3" timing: dependency: transitive description: @@ -1154,14 +1114,6 @@ packages: url: "https://pub.dev" source: hosted version: "6.3.0" - xxh3: - dependency: transitive - description: - name: xxh3 - sha256: a92b30944a9aeb4e3d4f3c3d4ddb3c7816ca73475cd603682c4f8149690f56d7 - url: "https://pub.dev" - source: hosted - version: "1.0.1" yaml: dependency: transitive description: diff --git a/ui/flutter/pubspec.yaml b/ui/flutter/pubspec.yaml index 2f90c3c07..4d8c41bdc 100644 --- a/ui/flutter/pubspec.yaml +++ b/ui/flutter/pubspec.yaml @@ -62,8 +62,6 @@ dependencies: open_file: ^3.3.2 flutter_form_builder: ^9.1.1 form_builder_validators: ^9.0.0 - isar: ^3.1.0+1 - isar_flutter_libs: ^3.1.0+1 dev_dependencies: flutter_test: sdk: flutter @@ -79,7 +77,6 @@ dev_dependencies: build_runner: ^2.2.1 json_serializable: ^6.3.2 flutter_launcher_icons: ^0.13.1 - isar_generator: ^3.1.0+1 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec From 1eb4f86089b1472f580667a3c5dd4b87ddfe213f Mon Sep 17 00:00:00 2001 From: Om Jogani Date: Sat, 21 Oct 2023 12:41:42 +0530 Subject: [PATCH 7/7] [Fix]: dart run & added locales in en_US --- ui/flutter/assets/locales/en_US.json | 5 ++++- ui/flutter/pubspec.yaml | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ui/flutter/assets/locales/en_US.json b/ui/flutter/assets/locales/en_US.json index 0306dbbce..974c3ed85 100644 --- a/ui/flutter/assets/locales/en_US.json +++ b/ui/flutter/assets/locales/en_US.json @@ -65,6 +65,9 @@ "extensionInstallSuccess": "Installed successfully", "extensionUpdateSuccess": "Updated successfully", "extensionDelete": "Delete Extension", - "extensionAlreadyLatest": "It's already the latest version" + "extensionAlreadyLatest": "It's already the latest version", + "history": "History", + "clearHistory": "Clear History", + "noHistoryFound": "No History Found" } diff --git a/ui/flutter/pubspec.yaml b/ui/flutter/pubspec.yaml index 4d8c41bdc..c2c5b4447 100644 --- a/ui/flutter/pubspec.yaml +++ b/ui/flutter/pubspec.yaml @@ -73,7 +73,7 @@ dev_dependencies: # rules and activating additional ones. flutter_lints: ^2.0.0 ffigen: ^8.0.2 - # build json model: flutter pub run build_runner build --delete-conflicting-outputs + # build json model: dart run build_runner build --delete-conflicting-outputs build_runner: ^2.2.1 json_serializable: ^6.3.2 flutter_launcher_icons: ^0.13.1