This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If pod install didn't work on M1 Mac OS, you could use this instead: | |
arch -x86_64 pod install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// By https://gabrimatic.info | |
/// Run in DartPad with: https://dartpad.dev/?id=c1889bf45d03e36f68120954373a3c56&null_safety=true | |
void main() { | |
final double baseMoney = 1000; | |
final double percentage = 1; | |
double moneyInMonth = baseMoney; | |
print( | |
'If you have $baseMoney\$ and earn the $percentage% of your total amount in each day, You\'ll have:'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Customize app/build.gradle as bellow: | |
android { | |
... | |
flavorDimensions "api" | |
productFlavors { | |
minApi18 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* fluttersaurus project src: https://github.com/felangel/fluttersaurus | |
Ideally, repositories aren't feature-specific. Repositories should be at the domain level and should be reusable across different applications. | |
It is very common for a single repository to be used by multiple feature-blocs. | |
You need to define what your domains are. | |
For example, they might be the user and chat: | |
- You should define the various API clients. | |
So, Where is the data coming from? Is it coming from one API or multiple? | |
- For each backend, there should be an API client in the packages subdirectory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:web_socket_channel/io.dart'; | |
import 'package:web_socket_channel/web_socket_channel.dart'; | |
class ChatPage extends StatefulWidget { | |
@override | |
_ChatPageState createState() => _ChatPageState(); | |
} | |
class _ChatPageState extends State<ChatPage> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:async'; | |
import 'package:path/path.dart'; | |
import 'package:sqflite/sqflite.dart'; | |
import 'Models/Group.dart'; | |
// using sqflite: ^1.2.1 | |
class GroupModel { | |
final int id; | |
final String title; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void _changeLangDialog() { | |
const int en = 1; | |
const int de = 2; | |
int lang = en; | |
Locale currentLocal = EasyLocalizationProvider.of(context).locale; | |
Locale deLocale = new Locale('de', 'DE'); | |
Locale enLocale = new Locale('en', 'US'); | |
lang = (currentLocal == enLocale) ? en : de; |