Skip to content

Instantly share code, notes, and snippets.

pacakage: intl: ^0.17.0
pacakage: syncfusion_flutter_datepicker: ^20.3.49
String _selectedDate = '';
String _dateCount = '';
String _range = '';
String _rangeCount = '';
DateRangePickerController dateRangePickerController =
DateRangePickerController();
import 'dart:math';
import 'package:flutter/services.dart';
class DateTextFormatter extends TextInputFormatter {
static const _maxChars = 8;
@override
TextEditingValue formatEditUpdate(
TextEditingValue oldValue, TextEditingValue newValue) {
TextEditingController searchCountry = TextEditingController();
List<Map<String, dynamic>> allCountry = [];
@override
void initState() {
super.initState();
allCountry = CountryPick().countries;
}
void searchCountryName(String enteredKeyword) {
@harsh1772
harsh1772 / country Code
Last active November 8, 2022 08:41
country pick
https://github.com/imtoori/CountryCodePicker/tree/master/flags
class CountryPick {
List<Map<String, dynamic>> countries = [
{
"english_name": "Afghanistan",
"arabic_name": "أفغانستان",
"alpha2_code": "AF",
"alpha3_code": "AFG",
"phone_code": "93",
For build generate:-
flutter build apk --release
For compress build generate:-
flutter build apk --split-per-abi
For no null safety:-
flutter run --no-sound-null-safety
For android 10 or above permission
android:requestLegacyExternalStorage="true"
For android build .aab file
flutter build appbundle --release
class ListIndianBank {
final List<Map<String, dynamic>> bankNameList = [
///101 Bank List:-
{
'Bank Name': 'State Bank of India (SBI)',
'Bank Balance': '09223766666',
'Mini Statement': '09223866666',
'Customer Care': '18004253800',
'Web View': 'https://www.sbi.co.in/',
},
1) for in-screen tabbar use
contained_tab_bar_view: ^0.8.0
2) for background service
flutter_background_service: ^2.0.0
add date in milliseconds
-------------------------
added_on = DateTime.now().millisecondsSinceEpoch.toString();
get date in milliseconds
-------------------------
DateTime.fromMillisecondsSinceEpoch(1625879685158,
isUtc: true)
.toString()
step 1 -> Create a flutter app
step 2 -> create views folder inside -> lib folder after that -> go inside views folder and create a stateful widget like ->
home_screen.dart (it must be stateful widget) -> because we need initState() method to work with PushNotification
step 3 -> Render home_screen.dart from main.dart as first screen from home: (Named Argument)
Now all setup is done to work with Pushnotification
step 4 -> add these 3 Dependencies in pubspec.yaml