From 821920bba34da5bc03efbc4d70bdc72caa150957 Mon Sep 17 00:00:00 2001 From: codewithJosh Date: Fri, 18 Nov 2022 18:08:11 +0800 Subject: [PATCH 1/5] feat: add `Home` layout --- lib/functions.dart | 40 +++++++++++++++++++++ lib/home_screen.dart | 84 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 123 insertions(+), 1 deletion(-) diff --git a/lib/functions.dart b/lib/functions.dart index 526f7c1..4586855 100644 --- a/lib/functions.dart +++ b/lib/functions.dart @@ -17,6 +17,7 @@ const colorChineseSilver = Color(0xffCCCCCC); const colorKUCrimson = Color(0xffE50913); const colorEerieBlack = Color(0xff1D1D1D); const colorElectricGreen = Color(0xff00FF00); +const colorRaisinBlack = Color(0xff262626); const linearButton = LinearGradient( begin: Alignment(0.0, -1.0), @@ -28,6 +29,16 @@ const linearButton = LinearGradient( stops: [0.0, 1.0], ); +const linearAppBar = LinearGradient( + begin: Alignment(0.0, -1.0), + end: Alignment(0.0, 1.0), + colors: [ + colorEerieBlack, + colorRaisinBlack, + ], + stops: [0.0, 1.0], +); + const createChineseBlackDecoration = ''; const createChineseBlackDecoration1 = @@ -36,6 +47,12 @@ const createLine = ''; const createLogo = ''; +const createLogoUIButton = + ''; +const createDrawerUIButton = + ' '; +const createCreateUpdateUIButton = + ''; final firebaseAuth = FirebaseAuth.instance; final firebaseFirestore = FirebaseFirestore.instance; @@ -284,3 +301,26 @@ buildFlutterToast(final msg, final color, {isLong = false}) => backgroundColor: colorChineseBlack, textColor: color, fontSize: 16.0); + +initTitle1() => Row( + children: const [ + + Text( + 'News', + style: TextStyle( + fontSize: 22, + color: Colors.white, + fontFamily: 'Tahoma', + ), + ), + + Text( + 'EXPOSÉ', + style: TextStyle( + fontSize: 22, + color: colorFulvous, + fontFamily: 'Tahoma', + ), + ) + ], +); \ No newline at end of file diff --git a/lib/home_screen.dart b/lib/home_screen.dart index 579c5f5..eb136e0 100644 --- a/lib/home_screen.dart +++ b/lib/home_screen.dart @@ -1,4 +1,7 @@ import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:news_expose_2k21/functions.dart'; class HomeScreen extends StatefulWidget { const HomeScreen({Key? key}) : super(key: key); @@ -8,8 +11,87 @@ class HomeScreen extends StatefulWidget { } class _HomeScreenState extends State { + + _initAppBar() => AppBar( + systemOverlayStyle: SystemUiOverlayStyle.light, + backgroundColor: colorChineseBlack, + toolbarHeight: 75.0, + + flexibleSpace: SafeArea( + child: Container( + alignment: Alignment.center, + decoration: const BoxDecoration( + gradient: linearAppBar, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + + Container( + margin: const EdgeInsets.only(left: 20.0), + child: SvgPicture.string( + createLogoUIButton, + allowDrawingOutsideViewBox: true, + fit: BoxFit.fill, + ), + ), + + initTitle1(), + + Container( + margin: const EdgeInsets.only(right: 20.0), + child: SvgPicture.string( + createDrawerUIButton, + allowDrawingOutsideViewBox: true, + fit: BoxFit.fill, + ), + ), + + ], + ), + ), + ), + ); + @override Widget build(BuildContext context) { - return Container(); + return Scaffold( + + appBar: _initAppBar(), + + body: Stack( + children: [ + + Container( + decoration: const BoxDecoration( + color: colorChineseBlack, + ), + ), + + SafeArea( + child: Stack( + children: [ + + Container( + alignment: Alignment.bottomRight, + padding: const EdgeInsets.only(right: 25.0, bottom: 25.0), + child: SizedBox( + width: 75.0, + height: 75.0, + child: SvgPicture.string( + createCreateUpdateUIButton, + allowDrawingOutsideViewBox: true, + fit: BoxFit.fill, + ), + ), + ) + + ], + ), + ), + ], + ), + + ); } } From dc894ccd3ee062ed7b82d57c5c5ff9073540d04f Mon Sep 17 00:00:00 2001 From: codewithJosh Date: Fri, 18 Nov 2022 21:33:13 +0800 Subject: [PATCH 2/5] feat: check if current user is admin --- lib/functions.dart | 15 ++++++++++++++ lib/home_screen.dart | 41 ++++++++++++++++++++++++++------------ lib/models/user_model.dart | 34 +++++++++++++++++++++++++++++++ lib/register_screen.dart | 6 +++--- 4 files changed, 80 insertions(+), 16 deletions(-) create mode 100644 lib/models/user_model.dart diff --git a/lib/functions.dart b/lib/functions.dart index 4586855..b5918a6 100644 --- a/lib/functions.dart +++ b/lib/functions.dart @@ -54,6 +54,8 @@ const createDrawerUIButton = const createCreateUpdateUIButton = ''; +final userId = firebaseAuth.currentUser!.uid; + final firebaseAuth = FirebaseAuth.instance; final firebaseFirestore = FirebaseFirestore.instance; @@ -323,4 +325,17 @@ initTitle1() => Row( ), ) ], +); + +buildCircularProgress() => Container( + alignment: Alignment.center, + child: const SizedBox( + height: 100.0, + width: 100.0, + child: CircularProgressIndicator( + valueColor: AlwaysStoppedAnimation( + colorPhilippineOrange + ), + ), + ), ); \ No newline at end of file diff --git a/lib/home_screen.dart b/lib/home_screen.dart index eb136e0..1c66000 100644 --- a/lib/home_screen.dart +++ b/lib/home_screen.dart @@ -3,6 +3,8 @@ import 'package:flutter/services.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:news_expose_2k21/functions.dart'; +import 'models/user_model.dart'; + class HomeScreen extends StatefulWidget { const HomeScreen({Key? key}) : super(key: key); @@ -72,19 +74,32 @@ class _HomeScreenState extends State { child: Stack( children: [ - Container( - alignment: Alignment.bottomRight, - padding: const EdgeInsets.only(right: 25.0, bottom: 25.0), - child: SizedBox( - width: 75.0, - height: 75.0, - child: SvgPicture.string( - createCreateUpdateUIButton, - allowDrawingOutsideViewBox: true, - fit: BoxFit.fill, - ), - ), - ) + FutureBuilder( + future: users.doc(userId).get(), + builder: (context, dataSnapshot) { + if(!dataSnapshot.hasData) { + return buildCircularProgress(); + } + + final user = User.fromDocument(dataSnapshot.data); + + return user.userIsAdmin == true + ? Container( + alignment: Alignment.bottomRight, + padding: const EdgeInsets.only(right: 25.0, bottom: 25.0), + child: SizedBox( + width: 75.0, + height: 75.0, + child: SvgPicture.string( + createCreateUpdateUIButton, + allowDrawingOutsideViewBox: true, + fit: BoxFit.fill, + ), + ), + ) + : Container(); + } + ), ], ), diff --git a/lib/models/user_model.dart b/lib/models/user_model.dart new file mode 100644 index 0000000..ccedf74 --- /dev/null +++ b/lib/models/user_model.dart @@ -0,0 +1,34 @@ + + +class User { + final String? buildNumber; + final String? userBio; + final String? userEmail; + final String? userId; + final String? userImage; + final bool? userIsAdmin; + final String? userName; + + User({ + this.buildNumber, + this.userBio, + this.userEmail, + this.userId, + this.userImage, + this.userIsAdmin, + this.userName, + }); + + factory User.fromDocument(final documentSnapshot) { + + return User( + buildNumber: documentSnapshot['build_number'], + userBio: documentSnapshot['user_bio'], + userEmail: documentSnapshot['user_email'], + userId: documentSnapshot['user_id'], + userImage: documentSnapshot['user_image'], + userIsAdmin: documentSnapshot['user_is_admin'], + userName: documentSnapshot['user_name'], + ); + } +} diff --git a/lib/register_screen.dart b/lib/register_screen.dart index f50b75d..7eb0f61 100644 --- a/lib/register_screen.dart +++ b/lib/register_screen.dart @@ -13,7 +13,7 @@ class RegisterScreen extends StatefulWidget { } class _RegisterScreenState extends State { - late String _username, _email, _password, _rePassword; + late String _userName, _email, _password, _rePassword; final _formKey = GlobalKey(); @@ -45,7 +45,7 @@ class _RegisterScreenState extends State { 'user_id': userId, 'user_image': userImage, 'user_is_admin': userIsAdmin, - 'user_name': _username, + 'user_name': _userName, }); } } @@ -151,7 +151,7 @@ class _RegisterScreenState extends State { } return null; }, - onSaved: (input) => _username = + onSaved: (input) => _userName = input!.trim().toLowerCase(), ), ), From d03c2a86da70eeb6f3b4becf123378951f5a9332 Mon Sep 17 00:00:00 2001 From: codewithJosh Date: Fri, 18 Nov 2022 23:09:49 +0800 Subject: [PATCH 3/5] feat: add `create update` nav button Include the ff. - build: add `Flutter Image Picker` API --- lib/create_update_screen.dart | 18 ++++++++ lib/functions.dart | 4 ++ lib/home_screen.dart | 87 +++++++++++++++++++++++++++++++---- pubspec.lock | 49 ++++++++++++++++++++ pubspec.yaml | 1 + 5 files changed, 151 insertions(+), 8 deletions(-) create mode 100644 lib/create_update_screen.dart diff --git a/lib/create_update_screen.dart b/lib/create_update_screen.dart new file mode 100644 index 0000000..e3e7b9c --- /dev/null +++ b/lib/create_update_screen.dart @@ -0,0 +1,18 @@ +import 'dart:io'; +import 'package:flutter/material.dart'; + +class CreateUpdateScreen extends StatefulWidget { + final File uri; + const CreateUpdateScreen({Key? key, required this.uri}) : super(key: key); + + @override + State createState() => _CreateUpdateScreenState(); +} + +class _CreateUpdateScreenState extends State { + + @override + Widget build(BuildContext context) { + return Container(); + } +} diff --git a/lib/functions.dart b/lib/functions.dart index b5918a6..2979e8d 100644 --- a/lib/functions.dart +++ b/lib/functions.dart @@ -53,6 +53,10 @@ const createDrawerUIButton = ' '; const createCreateUpdateUIButton = ''; +const createCameraUIButton = + ''; +const createGalleryUIButton = + ''; final userId = firebaseAuth.currentUser!.uid; diff --git a/lib/home_screen.dart b/lib/home_screen.dart index 1c66000..01094eb 100644 --- a/lib/home_screen.dart +++ b/lib/home_screen.dart @@ -1,8 +1,10 @@ +import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:image_picker/image_picker.dart'; +import 'package:news_expose_2k21/create_update_screen.dart'; import 'package:news_expose_2k21/functions.dart'; - import 'models/user_model.dart'; class HomeScreen extends StatefulWidget { @@ -14,6 +16,8 @@ class HomeScreen extends StatefulWidget { class _HomeScreenState extends State { + late File _uri; + _initAppBar() => AppBar( systemOverlayStyle: SystemUiOverlayStyle.light, backgroundColor: colorChineseBlack, @@ -55,6 +59,70 @@ class _HomeScreenState extends State { ), ); + _buildGetImage(final context) => showModalBottomSheet( + context: context, + builder: (context) => Container( + decoration: const BoxDecoration( + gradient: linearAppBar, + ), + height: 120, + child: Column( + children: [ + + _initListTile(context, 'Capture Image with Camera'), + + _initListTile(context, 'Select Image from Gallery') + + ], + ), + ) + ); + + _initListTile(final context, final text) => ListTile( + + leading: SizedBox( + width: 30.0, + height: 25.0, + child: SvgPicture.string( + text.contains('Capture Image with Camera') + ? createCameraUIButton + : createGalleryUIButton, + allowDrawingOutsideViewBox: true, + fit: BoxFit.fill, + ), + ), + + title: Text( + text, + style: const TextStyle( + color: Colors.white, + ), + ), + + onTap: () async { + final image = await ImagePicker().pickImage( + source: text.contains('Capture Image with Camera') + ? ImageSource.camera + : ImageSource.gallery + ); + Navigator.of(context).pop(); + setState(() { + _uri = File(image!.path); + }); + _onCreateUpdate(context); + }, + ); + + _onCreateUpdate(final context) { + + final route = MaterialPageRoute( + builder: (context) => CreateUpdateScreen( + uri: _uri + ) + ); + Navigator.of(context).push(route); + } + @override Widget build(BuildContext context) { return Scaffold( @@ -87,13 +155,16 @@ class _HomeScreenState extends State { ? Container( alignment: Alignment.bottomRight, padding: const EdgeInsets.only(right: 25.0, bottom: 25.0), - child: SizedBox( - width: 75.0, - height: 75.0, - child: SvgPicture.string( - createCreateUpdateUIButton, - allowDrawingOutsideViewBox: true, - fit: BoxFit.fill, + child: GestureDetector( + onTap: () => _buildGetImage(context), + child: SizedBox( + width: 75.0, + height: 75.0, + child: SvgPicture.string( + createCreateUpdateUIButton, + allowDrawingOutsideViewBox: true, + fit: BoxFit.fill, + ), ), ), ) diff --git a/pubspec.lock b/pubspec.lock index be92203..78a63dc 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -71,6 +71,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.16.0" + cross_file: + dependency: transitive + description: + name: cross_file + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.3+2" cupertino_icons: dependency: "direct main" description: @@ -146,6 +153,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.1" + flutter_plugin_android_lifecycle: + dependency: transitive + description: + name: flutter_plugin_android_lifecycle + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.7" flutter_svg: dependency: "direct main" description: @@ -184,6 +198,41 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "4.0.2" + image_picker: + dependency: "direct main" + description: + name: image_picker + url: "https://pub.dartlang.org" + source: hosted + version: "0.8.6" + image_picker_android: + dependency: transitive + description: + name: image_picker_android + url: "https://pub.dartlang.org" + source: hosted + version: "0.8.5+3" + image_picker_for_web: + dependency: transitive + description: + name: image_picker_for_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.10" + image_picker_ios: + dependency: transitive + description: + name: image_picker_ios + url: "https://pub.dartlang.org" + source: hosted + version: "0.8.6+1" + image_picker_platform_interface: + dependency: transitive + description: + name: image_picker_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.6.2" intl: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 433c389..39b9d9f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -60,6 +60,7 @@ dependencies: # add dependency on K. Ponnam Flutter Toast fluttertoast: ^8.1.1 + image_picker: ^0.8.6 dev_dependencies: flutter_test: From c0c3ee65974472c202e1847472e1e8324fafee65 Mon Sep 17 00:00:00 2001 From: codewithJosh Date: Fri, 18 Nov 2022 23:13:13 +0800 Subject: [PATCH 4/5] docs: update `pubspec` --- pubspec.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pubspec.yaml b/pubspec.yaml index 39b9d9f..42fd08d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -60,6 +60,8 @@ dependencies: # add dependency on K. Ponnam Flutter Toast fluttertoast: ^8.1.1 + + # add dependency on Flutter Image Picker image_picker: ^0.8.6 dev_dependencies: From e36a3876d1857a910830a64aaf1f986caa85e028 Mon Sep 17 00:00:00 2001 From: codewithJosh Date: Fri, 18 Nov 2022 23:16:19 +0800 Subject: [PATCH 5/5] refactor: finishing touches --- lib/create_update_screen.dart | 3 +- lib/functions.dart | 58 +++++------ lib/home_screen.dart | 187 +++++++++++++++------------------- lib/models/user_model.dart | 3 - 4 files changed, 111 insertions(+), 140 deletions(-) diff --git a/lib/create_update_screen.dart b/lib/create_update_screen.dart index e3e7b9c..9be56f3 100644 --- a/lib/create_update_screen.dart +++ b/lib/create_update_screen.dart @@ -1,8 +1,10 @@ import 'dart:io'; + import 'package:flutter/material.dart'; class CreateUpdateScreen extends StatefulWidget { final File uri; + const CreateUpdateScreen({Key? key, required this.uri}) : super(key: key); @override @@ -10,7 +12,6 @@ class CreateUpdateScreen extends StatefulWidget { } class _CreateUpdateScreenState extends State { - @override Widget build(BuildContext context) { return Container(); diff --git a/lib/functions.dart b/lib/functions.dart index 2979e8d..c440e6a 100644 --- a/lib/functions.dart +++ b/lib/functions.dart @@ -309,37 +309,33 @@ buildFlutterToast(final msg, final color, {isLong = false}) => fontSize: 16.0); initTitle1() => Row( - children: const [ - - Text( - 'News', - style: TextStyle( - fontSize: 22, - color: Colors.white, - fontFamily: 'Tahoma', - ), - ), - - Text( - 'EXPOSÉ', - style: TextStyle( - fontSize: 22, - color: colorFulvous, - fontFamily: 'Tahoma', - ), - ) - ], -); + children: const [ + Text( + 'News', + style: TextStyle( + fontSize: 22, + color: Colors.white, + fontFamily: 'Tahoma', + ), + ), + Text( + 'EXPOSÉ', + style: TextStyle( + fontSize: 22, + color: colorFulvous, + fontFamily: 'Tahoma', + ), + ) + ], + ); buildCircularProgress() => Container( - alignment: Alignment.center, - child: const SizedBox( - height: 100.0, - width: 100.0, - child: CircularProgressIndicator( - valueColor: AlwaysStoppedAnimation( - colorPhilippineOrange + alignment: Alignment.center, + child: const SizedBox( + height: 100.0, + width: 100.0, + child: CircularProgressIndicator( + valueColor: AlwaysStoppedAnimation(colorPhilippineOrange), + ), ), - ), - ), -); \ No newline at end of file + ); diff --git a/lib/home_screen.dart b/lib/home_screen.dart index 01094eb..35e6e07 100644 --- a/lib/home_screen.dart +++ b/lib/home_screen.dart @@ -1,10 +1,12 @@ import 'dart:io'; + import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:image_picker/image_picker.dart'; import 'package:news_expose_2k21/create_update_screen.dart'; import 'package:news_expose_2k21/functions.dart'; + import 'models/user_model.dart'; class HomeScreen extends StatefulWidget { @@ -15,137 +17,114 @@ class HomeScreen extends StatefulWidget { } class _HomeScreenState extends State { - late File _uri; _initAppBar() => AppBar( - systemOverlayStyle: SystemUiOverlayStyle.light, - backgroundColor: colorChineseBlack, - toolbarHeight: 75.0, - - flexibleSpace: SafeArea( - child: Container( - alignment: Alignment.center, - decoration: const BoxDecoration( - gradient: linearAppBar, - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - - Container( - margin: const EdgeInsets.only(left: 20.0), - child: SvgPicture.string( - createLogoUIButton, - allowDrawingOutsideViewBox: true, - fit: BoxFit.fill, - ), + systemOverlayStyle: SystemUiOverlayStyle.light, + backgroundColor: colorChineseBlack, + toolbarHeight: 75.0, + flexibleSpace: SafeArea( + child: Container( + alignment: Alignment.center, + decoration: const BoxDecoration( + gradient: linearAppBar, ), - - initTitle1(), - - Container( - margin: const EdgeInsets.only(right: 20.0), - child: SvgPicture.string( - createDrawerUIButton, - allowDrawingOutsideViewBox: true, - fit: BoxFit.fill, - ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + margin: const EdgeInsets.only(left: 20.0), + child: SvgPicture.string( + createLogoUIButton, + allowDrawingOutsideViewBox: true, + fit: BoxFit.fill, + ), + ), + initTitle1(), + Container( + margin: const EdgeInsets.only(right: 20.0), + child: SvgPicture.string( + createDrawerUIButton, + allowDrawingOutsideViewBox: true, + fit: BoxFit.fill, + ), + ), + ], ), - - ], + ), ), - ), - ), - ); + ); _buildGetImage(final context) => showModalBottomSheet( - context: context, - builder: (context) => Container( + context: context, + builder: (context) => Container( decoration: const BoxDecoration( gradient: linearAppBar, ), height: 120, child: Column( children: [ - _initListTile(context, 'Capture Image with Camera'), - _initListTile(context, 'Select Image from Gallery') - ], ), - ) - ); + )); _initListTile(final context, final text) => ListTile( - - leading: SizedBox( - width: 30.0, - height: 25.0, - child: SvgPicture.string( - text.contains('Capture Image with Camera') - ? createCameraUIButton - : createGalleryUIButton, - allowDrawingOutsideViewBox: true, - fit: BoxFit.fill, - ), - ), - - title: Text( - text, - style: const TextStyle( - color: Colors.white, - ), - ), - - onTap: () async { - final image = await ImagePicker().pickImage( - source: text.contains('Capture Image with Camera') - ? ImageSource.camera - : ImageSource.gallery + leading: SizedBox( + width: 30.0, + height: 25.0, + child: SvgPicture.string( + text.contains('Capture Image with Camera') + ? createCameraUIButton + : createGalleryUIButton, + allowDrawingOutsideViewBox: true, + fit: BoxFit.fill, + ), + ), + title: Text( + text, + style: const TextStyle( + color: Colors.white, + ), + ), + onTap: () async { + final image = await ImagePicker().pickImage( + source: text.contains('Capture Image with Camera') + ? ImageSource.camera + : ImageSource.gallery); + Navigator.of(context).pop(); + setState(() { + _uri = File(image!.path); + }); + _onCreateUpdate(context); + }, ); - Navigator.of(context).pop(); - setState(() { - _uri = File(image!.path); - }); - _onCreateUpdate(context); - }, - ); _onCreateUpdate(final context) { - - final route = MaterialPageRoute( - builder: (context) => CreateUpdateScreen( - uri: _uri - ) - ); + final route = + MaterialPageRoute(builder: (context) => CreateUpdateScreen(uri: _uri)); Navigator.of(context).push(route); } @override Widget build(BuildContext context) { return Scaffold( - appBar: _initAppBar(), - body: Stack( children: [ - Container( decoration: const BoxDecoration( color: colorChineseBlack, ), ), - SafeArea( child: Stack( children: [ - FutureBuilder( future: users.doc(userId).get(), builder: (context, dataSnapshot) { - if(!dataSnapshot.hasData) { + if (!dataSnapshot.hasData) { return buildCircularProgress(); } @@ -153,31 +132,29 @@ class _HomeScreenState extends State { return user.userIsAdmin == true ? Container( - alignment: Alignment.bottomRight, - padding: const EdgeInsets.only(right: 25.0, bottom: 25.0), - child: GestureDetector( - onTap: () => _buildGetImage(context), - child: SizedBox( - width: 75.0, - height: 75.0, - child: SvgPicture.string( - createCreateUpdateUIButton, - allowDrawingOutsideViewBox: true, - fit: BoxFit.fill, + alignment: Alignment.bottomRight, + padding: const EdgeInsets.only( + right: 25.0, bottom: 25.0), + child: GestureDetector( + onTap: () => _buildGetImage(context), + child: SizedBox( + width: 75.0, + height: 75.0, + child: SvgPicture.string( + createCreateUpdateUIButton, + allowDrawingOutsideViewBox: true, + fit: BoxFit.fill, + ), ), ), - ), - ) + ) : Container(); - } - ), - + }), ], ), ), ], ), - ); } } diff --git a/lib/models/user_model.dart b/lib/models/user_model.dart index ccedf74..898534d 100644 --- a/lib/models/user_model.dart +++ b/lib/models/user_model.dart @@ -1,5 +1,3 @@ - - class User { final String? buildNumber; final String? userBio; @@ -20,7 +18,6 @@ class User { }); factory User.fromDocument(final documentSnapshot) { - return User( buildNumber: documentSnapshot['build_number'], userBio: documentSnapshot['user_bio'],