From 456e09c879ee247aaef68b7c8c1a19178319450e Mon Sep 17 00:00:00 2001 From: niloysikdar Date: Sun, 2 May 2021 04:13:01 +0530 Subject: [PATCH] Added OxygenPostCard --- lib/main.dart | 4 +- lib/screens/showOxygenposts.dart | 73 ++++++++++++++++++++++++++++++++ lib/services/database.dart | 7 +++ 3 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 lib/screens/showOxygenposts.dart diff --git a/lib/main.dart b/lib/main.dart index 7a0ebfc..05ec130 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -3,7 +3,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:plaso_connect/constants/colors.dart'; -import 'package:plaso_connect/screens/addoxygen.dart'; +import 'package:plaso_connect/screens/showOxygenposts.dart'; Future main() async { WidgetsFlutterBinding.ensureInitialized(); @@ -30,7 +30,7 @@ class MyApp extends StatelessWidget { primaryColor: kelectronBlue, iconTheme: IconThemeData(color: kelectronBlue), ), - home: AddOxygenDetails(), + home: ShowOxygenPosts(), ); } } diff --git a/lib/screens/showOxygenposts.dart b/lib/screens/showOxygenposts.dart new file mode 100644 index 0000000..8703e42 --- /dev/null +++ b/lib/screens/showOxygenposts.dart @@ -0,0 +1,73 @@ +import 'package:flutter/material.dart'; +import 'package:plaso_connect/constants/colors.dart'; +import 'package:plaso_connect/widgets/boxdecoration.dart'; + +class ShowOxygenPosts extends StatelessWidget { + @override + Widget build(BuildContext context) { + Size size = MediaQuery.of(context).size; + return SafeArea( + child: Scaffold( + body: Column( + children: [ + Container( + margin: EdgeInsets.all(20), + padding: EdgeInsets.all(20), + decoration: newboxDecoration(), + width: size.width, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "This is a title", + style: TextStyle( + color: kelectronBlue, + fontSize: 22, + fontWeight: FontWeight.w600, + ), + ), + SizedBox(height: 3), + Text( + "This is a description", + style: TextStyle( + color: kelectronBlue, + fontSize: 20, + fontWeight: FontWeight.w500, + ), + ), + SizedBox(height: 3), + Text( + "Area PIN: 733202", + style: TextStyle( + color: kelectronBlue, + fontSize: 18, + fontWeight: FontWeight.w500, + ), + ), + SizedBox(height: 3), + Text( + "30/07/2001 -by Admin", + style: TextStyle( + color: Colors.grey[800], + fontSize: 18, + fontWeight: FontWeight.w500, + ), + ), + SizedBox(height: 3), + Text( + "Role: Admin", + style: TextStyle( + color: Colors.grey[800], + fontSize: 18, + fontWeight: FontWeight.w500, + ), + ), + ], + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/services/database.dart b/lib/services/database.dart index 7a6b3b7..5e52eb8 100644 --- a/lib/services/database.dart +++ b/lib/services/database.dart @@ -34,4 +34,11 @@ class DatabaseMethod { print(e.toString()); } } + + Stream getOxygen({required String pin}) { + return db + .collection("oxygenPosts") + .where("pin", isEqualTo: pin) + .snapshots(); + } }