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 { Menu, Drawer, Button, Flex, Typography, ConfigProvider } from "antd"; | |
import Sider from "antd/es/layout/Sider"; | |
import { Dispatch, SetStateAction } from "react"; | |
import { useLocation, useNavigate } from "react-router-dom"; | |
const { Text } = Typography; | |
interface Props { | |
collapsed?: boolean; | |
setCollapsed: React.Dispatch<React.SetStateAction<boolean>>; |
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
// ignore_for_file: public_member_api_docs, sort_constructors_first | |
import 'dart:convert'; | |
import 'package:flutter/foundation.dart'; | |
class ResponseModel { | |
final String id; | |
final String object; | |
final String model; | |
final List choices; |
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(); |
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) { |
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, |
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, |
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 | |
], | |
), | |
); |
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")); | |
} |
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) { |
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(); |
NewerOlder