Comments (12)
reading yaml and json files require first reading them from assets and then parsing them, which make the operation asynchronous and prone to runtime errors instead of compilation errors: https://suragch.medium.com/reading-configuration-files-and-settings-in-flutter-and-dart-cc14bbd93698 . I think, if possible, we could leverage yaml files, but only if we find a code generator step that could be plugged into the build phase that would then generate a dart file with the config accordingly, so that it's both compile-time check and does not require any loading or parsing in the runtime
from flutter.
@Zfinix mind taking on this issue?
from flutter.
from flutter.
@Zfinix mind taking on this issue?
We would use a .env file
from flutter.
I'd be cautious with .env files, especially due to this rule: https://dart.dev/tools/linter-rules#do_not_use_environment.
If I can suggest, we could reuse https://github.com/tendermint/flutter/blob/70ab5ce585d39b80cc5ce839300f5064fc9e66cb/starport_template/lib/utils/base_env.dart file, make the structure more flat and get rid of environment reading there.
Benefits of having this in dart is that's going to be easier to make the code that uses it testable, the state of the app is more deterministic and easier to inspect while developing
from flutter.
Dart already uses YAML extensively as a config file format. I wonder if we could use that? Both Starport CLI and the Vue template are using declarative config files (YAML and JSON respectively).
from flutter.
I see no issue having it in base_env.dart
we just need to document it so that its easy to update and find
I'd be cautious with .env files, especially due to this rule: https://dart.dev/tools/linter-rules#do_not_use_environment.
If I can suggest, we could reuse https://github.com/tendermint/flutter/blob/70ab5ce585d39b80cc5ce839300f5064fc9e66cb/starport_template/lib/utils/base_env.dart file, make the structure more flat and get rid of environment reading there.
Benefits of having this in dart is that's going to be easier to make the code that uses it testable, the state of the app is more deterministic and easier to inspect while developing
from flutter.
What do you suggest @wal33d006 ?
from flutter.
I think we should leverage things that do not take control away from us. So I think possibility of using yaml with code generator as suggested by Andrzej would be a good start along with using the dart environment file
from flutter.
@wal33d006 on thursday I and @andrzejchm agreed that we would not want to use a code generator as it brings in more complexity than needed, hence why we chose to repurpose the base_env
dart file
from flutter.
Sounds good, then we can drop the generator part, use the base env file to keep things in dart.
from flutter.
@Zfinix we agreed that build_runner is not a good idea, if we could find a code generator that seamlessly generates dart file as part of the flutter build
command, then it would be perfect solution, unfortunately I can't think of anything like that at the moment, so its more of a future-concept
from flutter.
Related Issues (20)
- Update the balance after transfer HOT 1
- Fees being reset after clicking the back button HOT 2
- Call getBalances upon successful transaction broadcast HOT 4
- Fix Overflow and Amount Formatting on Sign Transaction Page
- [Feature] Wallet Connect Integration
- Write docs on template release process HOT 5
- [Feature] Add Flutter Web option
- [Feature] Create 'cosmos_node_client' package HOT 1
- [Feature] [cosmos_node_client] Account derivation HOT 1
- [Feature] [cosmos_node_client] Transaction signing HOT 1
- [Bug] `CosmosCheckboxTile` doesn't have proper check/unchecked icons on dark/light themes
- [Feature] : (UI) Universal Menu Page Design
- [Feature] : (UI) Settings Page Design
- [Feature]: (UI) Accounts Pages
- [Feature] : (UI) Wallet Asset list Page
- [Feature] : (UI) Asset Details Native Token Page
- [Feature] template's error screen rich error info
- [Feature] make biometrics optional for wallet creation
- Issue confirming seed phrase with duplicate words
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter.