-
Notifications
You must be signed in to change notification settings - Fork 347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolve issue 359 #413
Resolve issue 359 #413
Conversation
Check |
I am extremely sorry if this is because of me using arch but it requires
|
Did you read my comment above? |
`file_selector` pkg & used rm useless pkgs
@Sarath191181208 is this PR ready for review? |
Yes |
/// | ||
/// You can provide a [subDir] where the boxes should be stored. | ||
Future<void> initHiveWithRootFolder(String appDir, [String? subDir]) async { | ||
WidgetsFlutterBinding.ensureInitialized(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WidgetsFlutterBinding.ensureInitialized(); should not be hidden in this function. It should be in main()
as it is currently.
|
||
init(join(appDir, subDir)); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of this extension. This task can be done by a hive utility function.
@@ -0,0 +1,30 @@ | |||
// Store hive save folder path. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are not models. They are shared_preferences utility functions.
Future<void> openBoxes() async { | ||
await Hive.initFlutter(); | ||
Future<void> openBoxes(String hiveSaveFolder) async { | ||
await Hive.initHiveWithRootFolder(hiveSaveFolder); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will get changed according to the comment above
import 'package:apidash/services/hive_services.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class HiveDirectorySelector extends StatefulWidget { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it require a Stateful Widget or Stateless can work?
Selecting a hive persistence folder
The flow of the app is as follows:
file_picker
package.shared_preferences
.NOTE: On Linux
file_picker
requires thezenity
package for picking files.Related Issues
Checklist
main
branch before making this PRflutter test
) and all tests are passing, except one test in /apidash/test/models/response_model_test.dart due to invalid SSL certificate of https://api.apidash.dev/Added/updated tests?
We encourage you to add relevant test cases.