View repeatNotify.dart
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
Future<void> repeatNotofication() async { | |
var androidChannelSpecifications = AndroidNotificationDetails( | |
"CHANNEL_ID 2", | |
"CHANNEL_NAME 2", | |
"CHANNEL_DESCRIPTION 2", | |
importance: Importance.max, | |
priority: Priority.high, | |
); | |
var iosChannelSpecifications = IOSNotificationDetails(); |
View list.dart
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 SliverListBldr extends StatelessWidget { | |
const SliverListBldr({ | |
Key? key, | |
}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return SliverList( | |
delegate: SliverChildBuilderDelegate( | |
(BuildContext context, int index) { |
View search.dart
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 SliverSearch extends StatelessWidget { | |
const SliverSearch({ | |
Key? key, | |
}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return SliverAppBar( | |
backgroundColor: Theme.of(context).scaffoldBackgroundColor, | |
elevation: 0, |
View appbar.dart
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 SliverAppBarBldr extends StatelessWidget { | |
const SliverAppBarBldr({ | |
Key? key, | |
}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return SliverAppBar( | |
backgroundColor: Theme.of(context).scaffoldBackgroundColor, | |
elevation: 0, |
View screen.dart
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
return const Scaffold( | |
body: CustomScrollView( | |
slivers: [ | |
SliverAppBarBldr(), // <- corresponds to the top most image | |
SliverSearch(), // <- corresponds to search bar widget | |
SliverListBldr(), // <- corresponds to the body lists containers | |
], | |
), | |
); |
View write_data.dart
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
Future<void> addStudents() async { | |
//creates a new doc with unique doc ID | |
return collectionRef | |
.add({ | |
'Name': "TestName", | |
}) | |
.then((value) => debugPrint("User Added")) | |
.catchError((error) => debugPrint("Failed to add user: $error")); | |
} |
View read_date.dart
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 FireStoreDataBase { | |
final CollectionReference collectionRef = | |
FirebaseFirestore.instance.collection("Students"); | |
Future getData() async { | |
try { | |
//to get data from a single/particular document alone. | |
var temp = await collectionRef.doc("<your document ID here>").get(); | |
return temp; | |
} catch (e) { |
View setBadge.dart
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
setBadgeNum(int count, BuildContext context) async { | |
try { | |
await FlutterDynamicIcon.setApplicationIconBadgeNumber(count); | |
} on PlatformException { | |
print('Exception: Platform not supported'); | |
} catch (e) { | |
print(e); | |
} | |
// To get currently badge number that was set. | |
int badgeNumber = await FlutterDynamicIcon.getApplicationIconBadgeNumber(); |
View btn.dart
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
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: buildAppBar(appBarTitle: title), | |
body: Center( | |
child: ElevatedButton( | |
style: getBtnStyle(context), | |
child: const Text('Set badge no'), | |
onPressed: () => setBadgeNum(5, context), | |
), |
View event.dart
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
changeAppIcon() async { | |
try { | |
if (await FlutterDynamicIcon.supportsAlternateIcons) { | |
await FlutterDynamicIcon.setAlternateIconName(iconName[iconIndex]); | |
debugPrint("App icon change successful"); | |
return; | |
} | |
} catch (e) { | |
debugPrint("Exception: ${e.toString()}"); | |
} |
NewerOlder