flutter_snow_base 2.3.0 flutter_snow_base: ^2.3.0 copied to clipboard
A new Flutter package that is used to base all flutter projects of snowmanlabs.
Flutter Snow Base! 🧰 #
🧰 A package that provides you the essential tools to use in your project, like:
- Easy config to use dark themes
- Ready for Flavors
- Ready to use Device Preview package that helps you to test your responsiveness
- Pre-configured Catcher
- Pre-configured locales
- Ready for i18n_extension package
- Ready to use flutter_modular package
- Extension of resource_network_fetcher package
Upgrade from 2.1.x to 2.2.x #
On this update, we removed the NetworkBoundResources()
constructor and transformed all methods to static. So, because
of this, is necessary some changes in the old code. We made a Regex that will help us to replace everything with
Android Studio or any other tool that helps you.
Find:
(?<=NetworkBoundResources)((.*?)\))(\n*)?(.*)?.as(.*?)\(
Replace to:
.as$5$2
Example:
📄 Table of Contents #
- Why should I use
- Motivations
- Examples
- Install
- Usage
- Useful links
- Author
- Contributing
- Show your support
- License
❓ Why should I use #
Flutter snow base helps you to initialize your project with ready tools to use, so if you want to use something, like test
your layout on different screens, you can only change a properly to true
and voilà! Or you need to pick all the errors
that occurs on the app, the device info and send to you when occurs the error, there's no need any efforts to this! You
only configure how you want to send, and is working!
🎯 Motivations #
We realized that almost all projects use the same things as a base, like a crash reporter, a flavor config, locales config... So, this package is a union of all the common packages through the projects.
📦 Examples #
Examples of to-do apps that used flutter_snow_base as base:
- Daily Nasa photo
- Todo clean
- Todo modular
- Example clean
- Example clean complete
- Example MVC modular
- Example MVC modular complete
🔧 Install #
Follow this tutorial: Installation tab
🎉 Usage #
NOTE: This package was made in conjunction with Flutter Snow Blower, so if you have some doubts of how to initialize this package in your project, only seed the documentation of Flutter Snow Blower or start a project with it to see how it works!
main.dart file #
void main() {
RunAppSnow(
ModularApp( // Material app
module: AppModule(),
),
flavorValues: Constants.flavorDev, // Pass your flavor values
getItInit: () => Resource.setErrorMapper(ErrorMapper.from), // if you want to execute something after flavors but before the app starts to run, this code will run here.
flavor: Flavor.dev, // Selected flavor
enableDevicePreview: false, // Enable if you want to use Device Preview.
errorReporter: (errorDetails) {}, // Use this function to use another crash reporter, like Crashanalytics of firebase.
);
}
material_app.dart #
This is the minimum configuration to use, you can add other parameters, that are the same as MaterialApp.
class AppWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return SnowMaterialApp(
theme: AppThemeData.themeDataLight,
darkTheme: AppThemeData.themeDataDark,
);
}
}
Useful links #
Shift + Alt + O -> Organize imports
https://material.io/design/typography/the-type-system.html#type-scale
https://medium.com/flutterando/qual-a-forma-f%C3%A1cil-de-traduzir-seu-app-flutter-para-outros-idiomas-ab5178cf0336 https://pub.dev/packages/i18n_extension#-readme-tab- https://medium.com/flutter-community/handling-network-calls-like-a-pro-in-flutter-31bd30c86be1 https://medium.com/flutter-community/page-transitions-using-themedata-in-flutter-c24afadb0b5d https://medium.com/flutter-community/handling-flutter-errors-with-catcher-efce74397862 https://medium.com/flutter-community/flutter-2019-real-splash-screens-tutorial-16078660c7a1 https://iiro.dev/2018/03/02/separating-build-environments/
Sempre divida os widgets em arquivos, e não em métodos dentro do widget
https://iiro.dev/2018/12/11/splitting-widgets-to-methods-performance-antipattern/
https://iiro.dev/2018/06/18/putting-build-methods-on-a-diet/
Exemplo: https://github.com/roughike/inKino/blob/development/mobile/lib/ui/event_details/event_backdrop_photo.dart
WidgetTesting: https://iiro.dev/2018/08/22/writing-widget-tests-for-navigation-events/
👤 Author #
Snowman labs #
- Website: snowmanlabs.com
- Twitter: @SnowmanLabs
- Github: @snowmanlabs
- LinkedIn: @SnowmanLabs
🤝 Contributing #
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
You can also take a look at the contributing guide.
💚 Show your support #
Give a ⭐️ if this project helped you!
📝 License #
Copyright © 2020 Snowman labs.
This project is BSD-3 Clause licensed.