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
pacakage: intl: ^0.17.0 | |
pacakage: syncfusion_flutter_datepicker: ^20.3.49 | |
String _selectedDate = ''; | |
String _dateCount = ''; | |
String _range = ''; | |
String _rangeCount = ''; | |
DateRangePickerController dateRangePickerController = | |
DateRangePickerController(); | |
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:math'; | |
import 'package:flutter/services.dart'; | |
class DateTextFormatter extends TextInputFormatter { | |
static const _maxChars = 8; | |
@override | |
TextEditingValue formatEditUpdate( | |
TextEditingValue oldValue, TextEditingValue newValue) { |
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
TextEditingController searchCountry = TextEditingController(); | |
List<Map<String, dynamic>> allCountry = []; | |
@override | |
void initState() { | |
super.initState(); | |
allCountry = CountryPick().countries; | |
} | |
void searchCountryName(String enteredKeyword) { |
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
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", |
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
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 |
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
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/', | |
}, |
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
1) for in-screen tabbar use | |
contained_tab_bar_view: ^0.8.0 | |
2) for background service | |
flutter_background_service: ^2.0.0 |
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
add date in milliseconds | |
------------------------- | |
added_on = DateTime.now().millisecondsSinceEpoch.toString(); | |
get date in milliseconds | |
------------------------- | |
DateTime.fromMillisecondsSinceEpoch(1625879685158, | |
isUtc: true) | |
.toString() |
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
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 |
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
Stream<QuerySnapshot<Object?>> getSuggestion(String suggestion, context) { | |
SellerModel? sellerModel = | |
Provider.of<UserProvider>(context, listen: false).sellerModel; | |
return seller_agreement_listing | |
.orderBy('itemName', descending: false) | |
.where('userId', isEqualTo: sellerModel!.uid) | |
.where('itemName', isGreaterThanOrEqualTo: suggestion) | |
.where('itemName', isLessThan: suggestion + 'z') | |
// .limit(limitOfRetrievedData!) |
NewerOlder