diff --git a/images/calendar_appbar.png b/images/calendar_appbar.png new file mode 100644 index 0000000..e8941f1 Binary files /dev/null and b/images/calendar_appbar.png differ diff --git a/images/edit_profile.png b/images/edit_profile.png new file mode 100644 index 0000000..f102f29 Binary files /dev/null and b/images/edit_profile.png differ diff --git a/images/edit_profile_drawer.png b/images/edit_profile_drawer.png new file mode 100644 index 0000000..bbbf482 Binary files /dev/null and b/images/edit_profile_drawer.png differ diff --git a/images/eye_icon.png b/images/eye_icon.png index c6ea74d..f351a51 100644 Binary files a/images/eye_icon.png and b/images/eye_icon.png differ diff --git a/images/financialsBottomIcon.png b/images/financialsBottomIcon.png new file mode 100644 index 0000000..3d2dcfc Binary files /dev/null and b/images/financialsBottomIcon.png differ diff --git a/images/homeBottomIcon.png b/images/homeBottomIcon.png new file mode 100644 index 0000000..c2b234e Binary files /dev/null and b/images/homeBottomIcon.png differ diff --git a/images/logout_drawer.png b/images/logout_drawer.png new file mode 100644 index 0000000..36f8def Binary files /dev/null and b/images/logout_drawer.png differ diff --git a/images/notification_appbar.png b/images/notification_appbar.png index f862a84..a44c0e2 100644 Binary files a/images/notification_appbar.png and b/images/notification_appbar.png differ diff --git a/images/ordersBottomIcon.png b/images/ordersBottomIcon.png new file mode 100644 index 0000000..7e9cdf3 Binary files /dev/null and b/images/ordersBottomIcon.png differ diff --git a/images/plansBottomIcon.png b/images/plansBottomIcon.png new file mode 100644 index 0000000..35f1584 Binary files /dev/null and b/images/plansBottomIcon.png differ diff --git a/images/profile_pic.png b/images/profile_pic.png new file mode 100644 index 0000000..7b244e1 Binary files /dev/null and b/images/profile_pic.png differ diff --git a/images/resourcesBottomIcon.png b/images/resourcesBottomIcon.png new file mode 100644 index 0000000..cb20373 Binary files /dev/null and b/images/resourcesBottomIcon.png differ diff --git a/lib/common/dashboard.dart b/lib/common/dashboard.dart index 256aace..3af2255 100644 --- a/lib/common/dashboard.dart +++ b/lib/common/dashboard.dart @@ -1,6 +1,13 @@ +import 'dart:convert'; +import 'dart:io'; +import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:image_picker/image_picker.dart'; import 'package:supplier_new/common/settings.dart'; +import '../login/login.dart'; + class DashboardScreen extends StatefulWidget { const DashboardScreen({super.key}); @@ -9,11 +16,673 @@ class DashboardScreen extends StatefulWidget { } class _DashboardScreenState extends State { + int _currentIndex = 0; + final ImagePicker _picker = ImagePicker(); + final storage = FlutterSecureStorage( + aOptions: AndroidOptions( + resetOnError: true, + encryptedSharedPreferences: true, + ), + ); + final GlobalKey _scaffoldKey = GlobalKey(); + + // Define a list of widgets for each screen + final List _screens = [ + HomeScreen(), + HomeScreen(), + HomeScreen(), + HomeScreen(), + HomeScreen(), + ]; + // List of bottom navigation bar items + final List _bottomNavItems = [ + BottomNavigationBarItem( + icon:Padding( + padding: EdgeInsets.fromLTRB(0,5,0,0), // Adjust height to control spacing + child:ImageIcon(AssetImage('images/homeBottomIcon.png')),), + // Replace with your image path + + label: "Home", + ), + BottomNavigationBarItem( + icon: Padding( + padding: EdgeInsets.fromLTRB(0,5,0,0), // Adjust height to control spacing + child: ImageIcon(AssetImage('images/ordersBottomIcon.png')), + ), + + label: "Orders", + ), + BottomNavigationBarItem( + icon: Padding( + padding: EdgeInsets.fromLTRB(0,5,0,0), // Adjust height to control spacing + child: ImageIcon(AssetImage('images/plansBottomIcon.png')), + ), // Replace with your image path + + label: "Plans", + ), + + + BottomNavigationBarItem( + icon: Padding( + padding: EdgeInsets.fromLTRB(0,5,0,0), // Adjust height to control spacing + child:ImageIcon(AssetImage('images/resourcesBottomIcon.png')),), + + // Replace with your image path + + label: "Resources", + ), + BottomNavigationBarItem( + icon:Padding( + padding: EdgeInsets.fromLTRB(0,5,0,0), // Adjust height to control spacing + child:ImageIcon(AssetImage('images/financialsBottomIcon.png')),), + // Replace with your image path + + label: "Financials", + ), + + + ]; + + void _onItemTapped(int index) { + setState(() { + _currentIndex = index; + }); + } + + Future pickImageFromGallery() async { + try { + final image = await _picker.pickImage(source: ImageSource.gallery); + if (image == null) return; + final imageTemp = File(image.path); + + AppSettings.preLoaderDialog(context); + bool isOnline = await AppSettings.internetConnectivity(); + if(isOnline) { + var res = await AppSettings.uploadrofileImageHTTPNew(image); + print(jsonDecode(res)); + Navigator.of(context, rootNavigator: true).pop(); + setState(() { + AppSettings.profilePictureUrl = jsonDecode(res)['picture']; + }); + AppSettings.saveData('profile', jsonDecode(res)['picture'], 'STRING'); + } + else{ + Navigator.of(context, rootNavigator: true).pop(); + AppSettings.longFailedToast('Please check interent'); + } + } on PlatformException catch (e) { + Navigator.of(context, rootNavigator: true).pop(); + AppSettings.longFailedToast('Failed to pick image: $e'); + } + } + + Future takeImageFromCamera() async { + try { + final image = await _picker.pickImage(source: ImageSource.camera); + if (image == null) return; + final imageTemp = File(image.path); + AppSettings.preLoaderDialog(context); + + + bool isOnline = await AppSettings.internetConnectivity(); + if(isOnline){ + var res = await AppSettings.uploadrofileImageHTTPNew(image); + print(jsonDecode(res)); + Navigator.of(context, rootNavigator: true).pop(); + setState(() { + AppSettings.profilePictureUrl = jsonDecode(res)['picture']; + }); + AppSettings.saveData('profile', jsonDecode(res)['picture'], 'STRING'); + } + else{ + Navigator.of(context, rootNavigator: true).pop(); + AppSettings.longFailedToast('Please check interent'); + } + + + } on PlatformException catch (e) { + Navigator.of(context, rootNavigator: true).pop(); + AppSettings.longFailedToast('Failed to pick image: $e'); + } + } + + showLogoutAlertDialog(context) { + return showDialog( + context: context, + barrierDismissible: false, + builder: (BuildContext context) { + return StatefulBuilder( + builder: (BuildContext context, StateSetter setState) { + return AlertDialog( + backgroundColor: Color(0XFFFFFFFF),// Set your desired background color + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), // Optional: Rounded corners + ), + title: Center(child: Text('Logout?',style:fontTextStyle(16,Color(0XFF101214),FontWeight.w700)),), + actions: [ + Center( + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Expanded(child: GestureDetector( + onTap: (){ + Navigator.of(context).pop(); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Color(0XFFFFFFFF), + border: Border.all( + width: 1, + color: Color(0XFF1D7AFC)), + borderRadius: BorderRadius.circular( + 12, + )), + alignment: Alignment.center, + child: Visibility( + visible: true, + child: Padding( + padding: EdgeInsets.fromLTRB(16,12,16,12), + child: Text( + 'Cancel', + style: fontTextStyle( + 12, + Color(0XFF1D7AFC), + FontWeight.w600)), + ), + ), + ), + ),), + SizedBox(width:MediaQuery.of(context).size.width * .016,), + Expanded(child: GestureDetector( + onTap: ()async{ + await storage.deleteAll(); + await Navigator.pushAndRemoveUntil( + context, + MaterialPageRoute(builder: (context) => Login()), + (Route route) => false, + ); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Color(0XFFE2483D), + border: Border.all( + width: 1, + color: Color(0XFFE2483D)), + borderRadius: BorderRadius.circular( + 12, + )), + alignment: Alignment.center, + child: Visibility( + visible: true, + child: Padding( + padding: EdgeInsets.fromLTRB(16,12,16,12), + child: Text( + 'Logout', + style: fontTextStyle( + 12, + Color(0XFFFFFFFF), + FontWeight.w600)), + ), + ), + ) + ),) + + + ], + ), + ), + ]); + }); + }); + } + + @override Widget build(BuildContext context) { - return Scaffold( - appBar:AppSettings.appBar('Dashboard'), + return WillPopScope( + onWillPop: () async { + if (_scaffoldKey.currentState?.isDrawerOpen ?? false) { + // If the drawer is open, close it + _scaffoldKey.currentState?.openEndDrawer(); + return false; // Prevent the default back action (exit the app) + } + else if (_currentIndex == 2) { + final shouldPop = await showDialog( + context: context, + builder: (context) { + return AlertDialog( + backgroundColor: Color(0XFFFFFFFF),// Set your desired background color + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), // Optional: Rounded corners + ), + title: Center(child: Text('Do you want to exit app?',style:fontTextStyle(16,Color(0XFF101214),FontWeight.w700)),), + actionsAlignment: MainAxisAlignment.spaceBetween, + actions: [ + Center( + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Expanded(child: GestureDetector( + onTap: (){ + Navigator.of(context).pop(false); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Color(0XFFFFFFFF), + border: Border.all( + width: 1, + color: Color(0XFF1D7AFC)), + borderRadius: BorderRadius.circular( + 12, + )), + alignment: Alignment.center, + child: Visibility( + visible: true, + child: Padding( + padding: EdgeInsets.fromLTRB(16,12,16,12), + child: Text( + 'Cancel', + style: fontTextStyle( + 12, + Color(0XFF1D7AFC), + FontWeight.w600)), + ), + ), + ), + ),), + SizedBox(width:MediaQuery.of(context).size.width * .016,), + Expanded(child: GestureDetector( + onTap: ()async{ + SystemNavigator.pop(); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Color(0XFF1D7AFC), + border: Border.all( + width: 1, + color: Color(0XFF1D7AFC)), + borderRadius: BorderRadius.circular( + 12, + )), + alignment: Alignment.center, + child: Visibility( + visible: true, + child: Padding( + padding: EdgeInsets.fromLTRB(16,12,16,12), + child: Text( + 'Confirm', + style: fontTextStyle( + 12, + Color(0XFFFFFFFF), + FontWeight.w600)), + ), + ), + ) + ),) + + + ], + ), + ), + ], + ); + }, + ); + return shouldPop!; + } + else { + setState(() { + _currentIndex = 2; + }); + return false; + } + }, + child: Scaffold( + key: _scaffoldKey, + backgroundColor: Colors.white, + appBar: AppBar( + backgroundColor: Colors.white, + elevation: 0, + scrolledUnderElevation: 0, + title: Text(_currentIndex==2?'Aquinto':_currentIndex==0?'History':_currentIndex==1?'Usage':_currentIndex==3?'Water Levels':'Resources',style: fontTextStyle(14,Color(0XFF2A2A2A),FontWeight.w500),), + iconTheme: IconThemeData(color: Color(0XFF2A2A2A)), + actions: [ + Row( + children: [ + Padding(padding: EdgeInsets.fromLTRB(10,10,0,10), + child: IconButton( + icon: Image( + image: AssetImage('images/calendar_appbar.png') + + ), + onPressed: (){ + }, + ), + ), + + Padding(padding: EdgeInsets.fromLTRB(0,10,10,10), + child: IconButton( + icon: Image.asset( + 'images/notification_appbar.png', // Example URL image + ), + onPressed: (){ + + }, + ), + ) + ], + ) + ], + leading: IconButton( + icon: Icon(Icons.menu), + onPressed: () { + _scaffoldKey.currentState?.openDrawer(); + }, + ), + ), + + drawer: Drawer( + width: MediaQuery.of(context).size.width, + backgroundColor: Colors.white, + child: Padding( + padding: EdgeInsets.all(8), + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox(height:MediaQuery.of(context).size.height * .05,), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + /* GestureDetector( + onTap: (){ + Navigator.of(context).pop(true); + }, + child: Image.asset('images/appbar_backbutton.png',height: 25,width: 25,color: Color(0XFF2A2A2A),), + ),*/ + SizedBox(width:MediaQuery.of(context).size.width * .04,), + Text( + 'Menu', + style: fontTextStyle(14,Color(0XFF2A2A2A),FontWeight.w500), + ), + ], + ), + SizedBox(height:MediaQuery.of(context).size.height * .016,), + Padding( padding: EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + /*CircleAvatar( + radius: 50, // Adjust the size of the circle + backgroundColor: Colors.grey[200], + backgroundImage:AppSettings.profilePictureUrl != + '' && + AppSettings.profilePictureUrl != + 'null'?NetworkImage(AppSettings + .profilePictureUrl) as ImageProvider: AssetImage('images/profile_pic.png',), // Your profile image + ),*/ + AppSettings.loginType.toString().toLowerCase()=='user'? + GestureDetector( + onTap: () { + /*Navigator.push( + context, + new MaterialPageRoute( + builder: (__) => new ImageZoomPage( + imageName: 'Profile', + imageDetails: AppSettings.profilePictureUrl)));*/ + }, + child: Stack( + alignment: Alignment.center, // Centers the stack's children + children: [ + + // CircleAvatar background + ClipOval( + child: Container( + height: 100, // Ensure the container's height is the same as the profile image + width: 100, + + decoration: BoxDecoration( + color: Colors.transparent, + shape: BoxShape.circle, // Makes the container circular + image: DecorationImage( + image: (AppSettings.profilePictureUrl != + '' && + AppSettings.profilePictureUrl != + 'null') + ? NetworkImage(AppSettings.profilePictureUrl) + as ImageProvider + : AssetImage( + "images/profile_pic.png"), // picked file + fit: BoxFit.cover)), + ), + ), + // Positioned image on top of CircleAvatar + Positioned( + bottom: 0, // Adjust position as needed + right: 0, // Adjust position as needed + child: Container( + width: 30, + height: 30, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.black.withOpacity(0.3), + blurRadius: 4, + offset: Offset(0, 2), // Shadow to make the edit icon pop + ), + ], + shape: BoxShape.circle, + color: Colors.white, // Background for the overlay + ), + + child: GestureDetector( + onTap: (){ + showModalBottomSheet( + context: context, + builder: (BuildContext context) { + return SizedBox( + height: 200, + child: Center( + child: Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + GestureDetector( + child: Icon( + Icons.camera_alt_outlined, + size: 100, + color: primaryColor, + ), + onTap: () async { + await takeImageFromCamera(); + Navigator.pop(context); + }, + ), + SizedBox( + width: MediaQuery.of(context) + .size + .width * + .20, + ), + GestureDetector( + child: Icon( + Icons.photo, + size: 100, + color: primaryColor, + ), + onTap: () async { + await pickImageFromGallery(); + Navigator.pop(context); + }, + ), + ], + ), + ), + ); + }); + }, + child: Image.asset( + 'images/edit_profile.png', // Ensure the image path is correct + fit: BoxFit.cover, + ), + ), + ), + ), + ], + ), + + ):ClipOval( + child: Container( + height: 100, // Ensure the container's height is the same as the profile image + width: 100, + + decoration: BoxDecoration( + color: Colors.transparent, + shape: BoxShape.circle, // Makes the container circular + image: DecorationImage( + image: (AssetImage( + "images/profile_pic.png")), // picked file + fit: BoxFit.contain)), + ), + ), + SizedBox(height:MediaQuery.of(context).size.height * .016,), + Text( + AppSettings.userName, + style: fontTextStyle(20,Color(0XFF2A2A2A),FontWeight.w500), + ), + Visibility( + visible:AppSettings.loginType.toString().toLowerCase()=='user', + child: Text( + AppSettings.email, + style: fontTextStyle(14,Color(0XFF2A2A2A),FontWeight.w400), + ),), + Text( + AppSettings.phoneNumber, + style: fontTextStyle(14,Color(0XFF2A2A2A),FontWeight.w400), + ), + ], + ),), + SizedBox(height:MediaQuery.of(context).size.height * .024,), + + ListTile( + title: Row( + children: [ + Image( + image: const AssetImage('images/logout_drawer.png'), + height: 25, + width: 25, + fit: BoxFit.fill), + SizedBox(width:MediaQuery.of(context).size.width * .04,), + Text('Logout', style: fontTextStyle(16,Color(0XFFE2483D),FontWeight.w400),), + ], + ), + onTap: () { + showLogoutAlertDialog(context); + }, + ), + + + + ], + ), + ), + ) + + ), + body: + _screens[_currentIndex], + /*_body(),,*/ + bottomNavigationBar: Padding( + padding:EdgeInsets.fromLTRB(0, 0, 0, 0) , + child: BottomNavigationBar( + backgroundColor: Color(0XFFFFFFFF), + items: _bottomNavItems, + selectedItemColor: primaryColor, // Color of selected icon and text + unselectedItemColor: Color(0XFF939495), // Color of unselected icon and text + selectedLabelStyle: fontTextStyleHeight(10,primaryColor,FontWeight.w400,MediaQuery.of(context).size.height * .0032,), + unselectedLabelStyle: fontTextStyleHeight(10,Color(0XFF939495),FontWeight.w400,MediaQuery.of(context).size.height * .0032,), + currentIndex: _currentIndex, + onTap: _onItemTapped, + /*onTap: (index) { + switch (index) { + case 0: + Navigator.push( + context, + MaterialPageRoute(builder: (context) => Resources()), + ); + break; + case 1: + Navigator.push( + context, + MaterialPageRoute(builder: (context) => TankLevels()), + ); + break; + + case 3: + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => Consumption()), + ); + break; + case 4: + Navigator.push( + context, + MaterialPageRoute(builder: (context) => SupplierManagementDashboard()), + ); + break; + } + },*/ + type: BottomNavigationBarType + .fixed, // Ensures all 6 items are visible + ), + ) + )); + } +} + + + +class HomeScreen extends StatefulWidget { + const HomeScreen({super.key}); + + @override + State createState() => _HomeScreenState(); +} + +class _HomeScreenState extends State { + + + + @override + Widget build(BuildContext context) { + return SingleChildScrollView( + child: Padding( + padding: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + "Hello! Welcome to ${AppSettings.buildingName}", + style: fontTextStyle(16,Color(0XFF2A2A2A),FontWeight.w600), + ), + SizedBox(height:MediaQuery.of(context).size.height * .03,), + + ], + ) + ), ); } } + + +// Screens for each bottom navigation item diff --git a/lib/common/settings.dart b/lib/common/settings.dart index 482a55e..1ef0b27 100644 --- a/lib/common/settings.dart +++ b/lib/common/settings.dart @@ -22,6 +22,28 @@ TextStyle fontTextStyle(double fontSize,Color fontColor,FontWeight weight) { ); } +TextStyle fontTextStyleHeight(double fontSize,Color fontColor,FontWeight weight,double height) { + return GoogleFonts.inter( + textStyle: TextStyle( + fontSize: fontSize, + fontWeight: weight, + color:fontColor, + height: height + ), + ); +} + +TextStyle fontTextStyleUnderline(double fontSize,Color fontColor,FontWeight weight) { + return GoogleFonts.inter( + textStyle: TextStyle( + fontSize: fontSize, + fontWeight: weight, + color:fontColor, + decoration: TextDecoration.underline, + ), + ); +} + InputDecoration textFormFieldDecoration(IconData icon,var text){ return InputDecoration( counterText: '', @@ -51,6 +73,36 @@ InputDecoration textFormFieldDecoration(IconData icon,var text){ ); } +InputDecoration textFormFieldDecorationHintText(IconData icon,var text){ + return InputDecoration( + counterText: '', + filled: false, + fillColor: Colors.white, + /*prefixIcon: Icon( + icon, + color: Colors.white, + ),*/ + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(15.0), + borderSide: BorderSide(color: greyColor, + width: 1, )), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(15.0), + borderSide: BorderSide(color: Color(0XFF8270DB),width: 2,), + ), + + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(15.0), + borderSide: BorderSide(color: greyColor), + ), + hintText: text, + hintStyle:fontTextStyle(14,Color(0XFF7E7F80),FontWeight.w400), + /* TextStyle(color: greyColor, fontWeight: FontWeight.bold //<-- SEE HERE + ),*/ + ); +} + + TextStyle PreloaderText() { return TextStyle(color:primaryColor); } @@ -76,13 +128,15 @@ class AppSettings{ static String customerIdsign = ''; static String profileImage = ''; static String preloadText = 'Please wait'; - + static String profilePictureUrl = ''; static String host = 'http://armintaaqua.com:3000/api/'; static String loginUrl = host + 'supplierlogin'; + static String signUpUrl = host + 'suppliers'; static String forgotPasswordUrl = host + 'forgotpassword'; static String resetTokenUrl = host + 'reset_token'; static String verifyPhnUrl = host + 'phone'; + static String uploadPicUrl = host + 'uploads-user'; // Shared preferences save,get and clear data @@ -181,6 +235,24 @@ class AppSettings{ } } + static Future signUp(payload) async { + var response = await http.post(Uri.parse(signUpUrl), + body: json.encode(payload), + headers: {'Content-type': 'application/json'}); + + if (response.statusCode == 200) { + try { + var _response = json.decode(response.body); + return true; + } catch (e) { + // display error toast + return false; + } + } else { + return false; + } + } + static Future resetToken() async { var uri = Uri.parse(resetTokenUrl + '/' + customerId); @@ -259,6 +331,15 @@ class AppSettings{ } } + static Future uploadrofileImageHTTPNew(file) async { + var request = http.MultipartRequest( + 'POST', Uri.parse(uploadPicUrl + '/' + customerId)); + request.files.add(await http.MultipartFile.fromPath('picture', file.path)); + var res = await request.send(); + var response = await http.Response.fromStream(res); + return response.body; + } + /*Apis ends here*/ diff --git a/lib/signup/otp_screen.dart b/lib/signup/otp_screen.dart index 3f6f7c7..740873d 100644 --- a/lib/signup/otp_screen.dart +++ b/lib/signup/otp_screen.dart @@ -84,7 +84,7 @@ class _OtpscreenState extends State { return SizedBox( width: 50, child: TextFormField( - cursorColor:Color(0XFF1D7AFC), + cursorColor:primaryColor, controller: _controllers[index], focusNode: index == 0 ? _focusNode : null, maxLength: 1, @@ -140,7 +140,7 @@ class _OtpscreenState extends State { Navigator.push( context, new MaterialPageRoute( - builder: (__) => new PasswordTextBoxesScreen())); + builder: (__) => new PasswordTextBoxesScreen(mobileNumber: widget.mobileNumber,))); /* await Navigator.push( context, MaterialPageRoute( diff --git a/lib/signup/password_textbox_screen.dart b/lib/signup/password_textbox_screen.dart index ab7120a..20c1a43 100644 --- a/lib/signup/password_textbox_screen.dart +++ b/lib/signup/password_textbox_screen.dart @@ -1,15 +1,191 @@ import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:supplier_new/common/settings.dart'; +import 'package:supplier_new/signup/signup.dart'; class PasswordTextBoxesScreen extends StatefulWidget { - const PasswordTextBoxesScreen({super.key}); + var mobileNumber; + PasswordTextBoxesScreen({ + this.mobileNumber + }); @override State createState() => _PasswordTextBoxesScreenState(); } class _PasswordTextBoxesScreenState extends State { + TextEditingController reEnterPasswordController = TextEditingController(); + TextEditingController createPasswordController = TextEditingController(); + bool isObscureText=true; + bool isObscureTextForReEnter=true; + @override Widget build(BuildContext context) { - return const Placeholder(); + + return Scaffold( + backgroundColor: Colors.white, + body: SingleChildScrollView( + child: Padding( + padding: EdgeInsets.all(24), + child: Column( + children: [ + SizedBox(height: MediaQuery.of(context).size.height * .2), + Center( + child: Text("AQUICK SUPPLIER", + style: fontTextStyle(20, Color(0XFF515253), FontWeight.w800)), + ), + SizedBox(height: MediaQuery.of(context).size.height * .05), + CircleAvatar(radius: 80, backgroundColor: Color(0XFFF3F1FB)), + SizedBox(height: MediaQuery.of(context).size.height * .05), + Center( + child: Text( + "Welcome to Aquick Supplier", + style: fontTextStyle(20, Color(0XFF343637), FontWeight.w700), + ), + ), + SizedBox(height: MediaQuery.of(context).size.height * .004), + Center( + child: Text( + "Sign up to be listed as a supplier, start deliveries and track orders", + style: fontTextStyle(12, Color(0XFF7E7F80), FontWeight.w400), + textAlign: TextAlign.center, // Keeps text centered in multiple lines + ), + ), + SizedBox(height:MediaQuery.of(context).size.height * .016,), + Container( + child: TextFormField( + cursorColor:Color(0XFF8270DB), + obscureText: isObscureText, + obscuringCharacter: '*', + controller: createPasswordController, + decoration: InputDecoration( + filled: false, + fillColor: Colors.white, + labelText: 'Create Password', + //prefixIcon: const Icon(Icons.lock, color: Colors.white,), + labelStyle: fontTextStyle(14,Color(0XFF7E7F80),FontWeight.w400), + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(4.0), + borderSide: BorderSide(color: greyColor, + width: 1, )), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(4.0), + borderSide: BorderSide(color: Color(0XFF8270DB),width: 2,), + ), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(4.0), + borderSide: BorderSide(color: greyColor), + ), + + suffixIcon: IconButton( + icon: isObscureText==true?Image.asset('images/eye_icon.png',color: Color(0XFF7E7F80),width: 16,height: 16,):Image.asset('images/open_eye.png',color:Color(0XFF7E7F80),width: 16,height: 16,), + /* Icon( + icon:Image.asset('assets/your_image.png'), + color: isObscureText==true?greyColor:primaryColor, + ),*/ + onPressed: () { + + print("show password"); + setState(() { + isObscureText = !isObscureText; + }); + }, + ), + + ), + style: fontTextStyle(14,Color(0XFF2A2A2A),FontWeight.w400), + + ), + ), + SizedBox(height:MediaQuery.of(context).size.height * .012,), + Container( + child: TextFormField( + cursorColor:Color(0XFF8270DB), + obscureText: isObscureTextForReEnter, + obscuringCharacter: '*', + controller: reEnterPasswordController, + decoration: InputDecoration( + filled: false, + fillColor: Colors.white, + labelText: 'Re Enter Password', + //prefixIcon: const Icon(Icons.lock, color: Colors.white,), + labelStyle: fontTextStyle(14,Color(0XFF7E7F80),FontWeight.w400), + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(4.0), + borderSide: BorderSide(color: greyColor, + width: 1, )), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(4.0), + borderSide: BorderSide(color: Color(0XFF8270DB),width: 2,), + ), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(4.0), + borderSide: BorderSide(color: greyColor), + ), + + suffixIcon: IconButton( + icon: isObscureTextForReEnter==true?Image.asset('images/eye_icon.png',color: Color(0XFF7E7F80),width: 16,height: 16,):Image.asset('images/open_eye.png',color:Color(0XFF7E7F80),width: 16,height: 16,), + /* Icon( + icon:Image.asset('assets/your_image.png'), + color: isObscureText==true?greyColor:primaryColor, + ),*/ + onPressed: () { + + print("show password"); + setState(() { + isObscureTextForReEnter = !isObscureTextForReEnter; + }); + }, + ), + + ), + style: fontTextStyle(14,Color(0XFF2A2A2A),FontWeight.w400), + + ), + ), + SizedBox(height: MediaQuery.of(context).size.height * .04), + Container( + width: double.infinity, + height: MediaQuery.of(context).size.height * .06, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + foregroundColor: Colors.white, + backgroundColor: primaryColor, + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(24.0), // Customize the radius + ), + ), + onPressed: () async{ + String createPassword = createPasswordController.text.trim(); + String reEnterPassword = reEnterPasswordController.text.trim(); + if (createPassword.isEmpty || reEnterPassword.isEmpty) { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar(content: Text("Please fill both password fields")), + ); + } else if (createPassword != reEnterPassword) { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar(content: Text("Passwords do not match")), + ); + } else { + // ✅ Passwords match → navigate to next page + Navigator.push( + context, + MaterialPageRoute(builder: (context) => SignUp(mobileNumber: widget.mobileNumber,password: createPasswordController.text,)), // replace with your next page + ); + } + }, + child: Text( + 'Login', + style: fontTextStyle(14, Color(0XFFFFFFFF), FontWeight.w600), + ), + )), + SizedBox(height: MediaQuery.of(context).size.height * .012), + ], + ), + ), + ) + ); } } + diff --git a/lib/signup/signup.dart b/lib/signup/signup.dart index 84f6a09..2ca8694 100644 --- a/lib/signup/signup.dart +++ b/lib/signup/signup.dart @@ -1,16 +1,50 @@ import 'package:flutter/material.dart'; +import 'package:flutter_secure_storage/flutter_secure_storage.dart'; +import 'package:shared_preferences/shared_preferences.dart'; import 'package:supplier_new/signup/verification_screen.dart'; import '../common/settings.dart'; class SignUp extends StatefulWidget { - const SignUp({super.key}); + var mobileNumber; + var password; + SignUp({ + this.mobileNumber,this.password + }); @override State createState() => _SignUpState(); } class _SignUpState extends State { + final TextEditingController businessNameController = TextEditingController(); + final TextEditingController registrationNumberController = TextEditingController(); + final TextEditingController yearsInBusinessController = TextEditingController(); + final TextEditingController contactNameController = TextEditingController(); + final TextEditingController positionController = TextEditingController(); + final TextEditingController mobileNumberController = TextEditingController(); + final TextEditingController additionalMobileController = TextEditingController(); + final TextEditingController emailController = TextEditingController(); + final TextEditingController addressLine1Controller = TextEditingController(); + final TextEditingController addressLine2Controller = TextEditingController(); + final TextEditingController cityController = TextEditingController(); + final TextEditingController stateController = TextEditingController(); + final TextEditingController zipController = TextEditingController(); + + final storage = FlutterSecureStorage( + aOptions: AndroidOptions( + resetOnError: true, + encryptedSharedPreferences: true, + ), + ); + + + @override + void initState() { + super.initState(); + mobileNumberController.text = widget.mobileNumber ?? ''; + } + @override Widget build(BuildContext context) { return Scaffold( @@ -53,9 +87,9 @@ class _SignUpState extends State { ), const SizedBox(height: 10), - _buildTextField('Business Name *', 'Enter your Business Name'), - _buildTextField('Registration Number *', 'Business Registration Number'), - _buildTextField('Years in Business *', 'Years of operation'), + _buildTextField('Business Name *', 'Enter your Business Name',businessNameController), + _buildTextField('Registration Number *', 'Business Registration Number',registrationNumberController), + _buildTextField('Years in Business *', 'Years of operation',yearsInBusinessController), const SizedBox(height: 24), Text( @@ -64,11 +98,11 @@ class _SignUpState extends State { ), const SizedBox(height: 10), - _buildTextField('Primary Contact Name *', 'Full Name'), - _buildTextField('Position/Title *', 'Job title'), - _buildTextField('Mobile Number *', 'Mobile Number'), - _buildTextField('Additional Mobile Number', 'Alternate Number'), - _buildTextField('Email Address', 'Email Address'), + _buildTextField('Primary Contact Name *', 'Full Name',contactNameController), + _buildTextField('Position/Title *', 'Job title',positionController), + _buildTextField('Mobile Number *', 'Mobile Number',mobileNumberController,readOnly: true), + _buildTextField('Additional Mobile Number', 'Alternate Number',additionalMobileController), + _buildTextField('Email Address', 'Email Address',emailController), const SizedBox(height: 24), Text( @@ -77,11 +111,11 @@ class _SignUpState extends State { ), const SizedBox(height: 10), - _buildTextField('Address Line 1 *', '123 Main St'), - _buildTextField('Address Line 2(Optional)', 'Area'), - _buildTextField('City *', 'City'), - _buildTextField('State/Province *', 'State'), - _buildTextField('ZIP/Postal Code ', '12345'), + _buildTextField('Address Line 1 *', '123 Main St',addressLine1Controller), + _buildTextField('Address Line 2(Optional)', 'Area',addressLine2Controller), + _buildTextField('City *', 'City',cityController), + _buildTextField('State/Province *', 'State',stateController), + _buildTextField('ZIP/Postal Code *', '12345',zipController), const SizedBox(height: 10), Padding( @@ -106,21 +140,94 @@ class _SignUpState extends State { SizedBox( width: double.infinity, child: ElevatedButton( - onPressed: () { - // Submit logic goes here - Navigator.push( - context, - MaterialPageRoute(builder: (context) => VerificationScreen()), - ); + onPressed: () async{ + if (businessNameController.text != ''&& + registrationNumberController.text != ''&& + yearsInBusinessController.text != ''&& + contactNameController.text != ''&& + mobileNumberController.text != ''&& + positionController.text != ''&& + addressLine1Controller.text != ''&& + addressLine2Controller.text != ''&& + cityController.text != ''&& + stateController.text != ''&& + zipController.text != '' + ) { + AppSettings.preLoaderDialog(context); + + bool isOnline = await AppSettings.internetConnectivity(); + + if(isOnline){ + SharedPreferences prefs = await SharedPreferences.getInstance(); + String? fcmToken = prefs.getString('fcmToken'); + var payload = new Map(); + + payload["suppliername"] = contactNameController.text.toString(); + payload["phone"] = mobileNumberController.text.toString(); + payload["alternativeContactNumber"] = additionalMobileController.text.toString(); + payload["password"] = widget.password; + payload["emails"] = [ + {"email": emailController.text.toString()} + ]; + + payload["office_address"] = addressLine1Controller.text.toString(); + payload["city"] = cityController.text.toString(); + payload["state"] = stateController.text.toString(); + payload["zip"] = zipController.text.toString(); + payload["country"] = ''; + payload["latitude"] = 0; + payload["longitude"] = 0; + payload["fcmId"] = fcmToken; + payload["description"] =''; + payload["bussinessname"] = businessNameController.text.toString(); + payload["registration_number"] = registrationNumberController.text.toString(); + payload["years_in_business"] = yearsInBusinessController.text.toString(); + + + bool signinStatus = await AppSettings.signUp(payload); + + try{ + if (signinStatus) { + Navigator.of(context,rootNavigator: true).pop(); + /* String token = AppSettings.accessToken; + await storage.write(key: 'authToken', value: token);*/ + Navigator.push( + context, + MaterialPageRoute(builder: (context) => VerificationScreen()), + ); + AppSettings.longSuccessToast("Logged in Successfully"); + + } else { + Navigator.of(context,rootNavigator: true).pop(); + AppSettings.longFailedToast("Invalid details"); + } + } + catch(exception){ + Navigator.of(context,rootNavigator: true).pop(); + print(exception); + } + } + else{ + Navigator.of(context,rootNavigator: true).pop(); + AppSettings.longFailedToast("Please Check internet"); + } + } + else{ + + AppSettings.longFailedToast("Please enter valid details"); + } + + + }, style: ElevatedButton.styleFrom( - backgroundColor: Colors.blueAccent, + backgroundColor: primaryColor, padding: const EdgeInsets.symmetric(vertical: 16), ), child: Text( 'Submit', - style: fontTextStyle(16, Colors.white, FontWeight.w600), + style: fontTextStyle(16, Color(0XFFFFFFFF), FontWeight.w600), ), ), ), @@ -130,7 +237,7 @@ class _SignUpState extends State { ); } - Widget _buildTextField(String label, String hint) { + Widget _buildTextField(String label, String hint,TextEditingController controller, {bool readOnly = false}) { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -139,15 +246,13 @@ class _SignUpState extends State { style: fontTextStyle(12, Color(0xFF2D2E30),FontWeight.w500), ), const SizedBox(height: 6), - TextField( - decoration: InputDecoration( - hintText: hint, - hintStyle: fontTextStyle(13, Colors.grey.shade600, FontWeight.normal), - border: OutlineInputBorder( - borderRadius: BorderRadius.circular(8), - ), - contentPadding: const EdgeInsets.symmetric(horizontal: 12, vertical: 14), - ), + TextFormField( + controller: controller, + readOnly: readOnly, + textCapitalization: TextCapitalization.sentences, + style:fontTextStyle(14,Color(0XFF2A2A2A),FontWeight.w400), + cursorColor: Color(0XFF8270DB), + decoration: textFormFieldDecorationHintText(Icons.phone,hint), ), const SizedBox(height: 16), ], diff --git a/lib/signup/signup_mobilenumber_screen.dart b/lib/signup/signup_mobilenumber_screen.dart index 661c7b0..fe2b6ab 100644 --- a/lib/signup/signup_mobilenumber_screen.dart +++ b/lib/signup/signup_mobilenumber_screen.dart @@ -20,131 +20,134 @@ class _SignUpMobileNumberScreenState extends State { return Scaffold( backgroundColor: Colors.white, - body: Padding( - padding: EdgeInsets.all(24), - child: Column( - children: [ - SizedBox(height: MediaQuery.of(context).size.height * .2), - Center( - child: Text("AQUICK SUPPLIER", - style: fontTextStyle(20, Color(0XFF515253), FontWeight.w800)), - ), - SizedBox(height: MediaQuery.of(context).size.height * .05), - CircleAvatar(radius: 80, backgroundColor: Color(0XFFF3F1FB)), - SizedBox(height: MediaQuery.of(context).size.height * .05), - Center( - child: Text( - "Welcome to Aquick Supplier", - style: fontTextStyle(20, Color(0XFF343637), FontWeight.w700), + body: SingleChildScrollView( + child: Padding( + padding: EdgeInsets.all(24), + child: Column( + children: [ + SizedBox(height: MediaQuery.of(context).size.height * .2), + Center( + child: Text("AQUICK SUPPLIER", + style: fontTextStyle(20, Color(0XFF515253), FontWeight.w800)), ), - ), - SizedBox(height: MediaQuery.of(context).size.height * .004), - Center( - child: Text( - "Sign up to be listed as a supplier, start deliveries and track orders", - style: fontTextStyle(12, Color(0XFF7E7F80), FontWeight.w400), - textAlign: TextAlign.center, // Keeps text centered in multiple lines + SizedBox(height: MediaQuery.of(context).size.height * .05), + CircleAvatar(radius: 80, backgroundColor: Color(0XFFF3F1FB)), + SizedBox(height: MediaQuery.of(context).size.height * .05), + Center( + child: Text( + "Welcome to Aquick Supplier", + style: fontTextStyle(20, Color(0XFF343637), FontWeight.w700), + ), + ), + SizedBox(height: MediaQuery.of(context).size.height * .004), + Center( + child: Text( + "Sign up to be listed as a supplier, start deliveries and track orders", + style: fontTextStyle(12, Color(0XFF7E7F80), FontWeight.w400), + textAlign: TextAlign.center, // Keeps text centered in multiple lines + ), ), - ), - SizedBox(height:MediaQuery.of(context).size.height * .016,), - Container( - child: TextFormField( - controller: mobileNumberController, - keyboardType: TextInputType.number, - textCapitalization: TextCapitalization.sentences, - maxLength: 10, - decoration: textFormFieldDecoration(Icons.phone,'Mobile Number'), - style:fontTextStyle(14,Color(0XFF2A2A2A),FontWeight.w400), - cursorColor: Color(0XFF8270DB), - - //TextStyle(color: Colors.black,fontWeight: FontWeight.bold), + SizedBox(height:MediaQuery.of(context).size.height * .016,), + Container( + child: TextFormField( + controller: mobileNumberController, + keyboardType: TextInputType.number, + textCapitalization: TextCapitalization.sentences, + maxLength: 10, + decoration: textFormFieldDecoration(Icons.phone,'Mobile Number'), + style:fontTextStyle(14,Color(0XFF2A2A2A),FontWeight.w400), + cursorColor: Color(0XFF8270DB), + + //TextStyle(color: Colors.black,fontWeight: FontWeight.bold), + ), ), - ), - SizedBox(height: MediaQuery.of(context).size.height * .04), - Container( - width: double.infinity, - height: MediaQuery.of(context).size.height * .06, - child: ElevatedButton( - style: ElevatedButton.styleFrom( - foregroundColor: Colors.white, - backgroundColor: primaryColor, - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(24.0), // Customize the radius + SizedBox(height: MediaQuery.of(context).size.height * .04), + Container( + width: double.infinity, + height: MediaQuery.of(context).size.height * .06, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + foregroundColor: Colors.white, + backgroundColor: primaryColor, + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(24.0), // Customize the radius + ), ), - ), - onPressed: () async{ - if(mobileNumberController.text.length>=10){ + onPressed: () async{ + if(mobileNumberController.text.length>=10){ - AppSettings.preLoaderDialog(context); + AppSettings.preLoaderDialog(context); - bool isOnline = await AppSettings.internetConnectivity(); - if(isOnline){ + bool isOnline = await AppSettings.internetConnectivity(); + if(isOnline){ - var payload = new Map(); - payload["phone"] = mobileNumberController.text.toString(); + var payload = new Map(); + payload["phone"] = mobileNumberController.text.toString(); - bool forgotPwd = await AppSettings.getOtp(payload); + bool forgotPwd = await AppSettings.getOtp(payload); - if(forgotPwd){ - Navigator.of(context,rootNavigator: true).pop(); - Navigator.push( - context, - new MaterialPageRoute( - builder: (__) => new Otpscreen(mobileNumber:mobileNumberController.text.toString()))); + if(forgotPwd){ + Navigator.of(context,rootNavigator: true).pop(); + Navigator.push( + context, + new MaterialPageRoute( + builder: (__) => new Otpscreen(mobileNumber:mobileNumberController.text.toString()))); + } + else{ + AppSettings.longFailedToast('Please enter valid registered mobile number'); + } } else{ - AppSettings.longFailedToast('Please enter valid registered mobile number'); + Navigator.of(context,rootNavigator: true).pop(); + AppSettings.longFailedToast("Please Check internet"); } - } - else{ - Navigator.of(context,rootNavigator: true).pop(); - AppSettings.longFailedToast("Please Check internet"); - } - } - else{ - AppSettings.longFailedToast('Please enter 10 digits of mobile number'); - } + } + else{ + AppSettings.longFailedToast('Please enter 10 digits of mobile number'); + } + }, + child: Text( + 'Continue', + style: fontTextStyle(14, Color(0XFFFFFFFF), FontWeight.w600), + ), + )), + SizedBox(height: MediaQuery.of(context).size.height * .012), + Container( + width: double.infinity, + height: MediaQuery.of(context).size.height * .06, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + foregroundColor: Color(0XFF757575), + backgroundColor: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(24.0), // Customize the radius + side: BorderSide( + color: Color(0XFF757575), // Border color + width: 1, // Border width + ), + ), + ), + onPressed: () async { + Navigator.pop(context); }, child: Text( - 'Continue', - style: fontTextStyle(14, Color(0XFFFFFFFF), FontWeight.w600), + 'Back', + style: fontTextStyle(14, Color(0XFF646566), FontWeight.w500), ), - )), - SizedBox(height: MediaQuery.of(context).size.height * .012), - Container( - width: double.infinity, - height: MediaQuery.of(context).size.height * .06, - child: ElevatedButton( - style: ElevatedButton.styleFrom( - foregroundColor: Color(0XFF757575), - backgroundColor: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(24.0), // Customize the radius - side: BorderSide( - color: Color(0XFF757575), // Border color - width: 1, // Border width - ), - ), - ), - onPressed: () async { - // Your onPressed logic - }, - child: Text( - 'Back', - style: fontTextStyle(14, Color(0XFF646566), FontWeight.w500), ), - ), - ) - ], + ) + ], + ), ), - )); + ) + ); } } diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index d0e7f79..85a2413 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -6,9 +6,13 @@ #include "generated_plugin_registrant.h" +#include #include void fl_register_plugins(FlPluginRegistry* registry) { + g_autoptr(FlPluginRegistrar) file_selector_linux_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin"); + file_selector_plugin_register_with_registrar(file_selector_linux_registrar); g_autoptr(FlPluginRegistrar) flutter_secure_storage_linux_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStorageLinuxPlugin"); flutter_secure_storage_linux_plugin_register_with_registrar(flutter_secure_storage_linux_registrar); diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index b29e9ba..62e3ed5 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -3,6 +3,7 @@ # list(APPEND FLUTTER_PLUGIN_LIST + file_selector_linux flutter_secure_storage_linux ) diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 48a819b..e61fc6d 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,6 +5,7 @@ import FlutterMacOS import Foundation +import file_selector_macos import firebase_core import firebase_messaging import flutter_secure_storage_macos @@ -12,6 +13,7 @@ import path_provider_foundation import shared_preferences_foundation func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin")) FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) FLTFirebaseMessagingPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseMessagingPlugin")) FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin")) diff --git a/pubspec.lock b/pubspec.lock index 9b6540a..9ac7938 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -49,6 +49,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.18.0" + cross_file: + dependency: transitive + description: + name: cross_file + sha256: "7caf6a750a0c04effbb52a676dce9a4a592e10ad35c34d6d2d0e4811160d5670" + url: "https://pub.dev" + source: hosted + version: "0.3.4+2" crypto: dependency: transitive description: @@ -89,6 +97,38 @@ packages: url: "https://pub.dev" source: hosted version: "7.0.1" + file_selector_linux: + dependency: transitive + description: + name: file_selector_linux + sha256: "54cbbd957e1156d29548c7d9b9ec0c0ebb6de0a90452198683a7d23aed617a33" + url: "https://pub.dev" + source: hosted + version: "0.9.3+2" + file_selector_macos: + dependency: transitive + description: + name: file_selector_macos + sha256: "271ab9986df0c135d45c3cdb6bd0faa5db6f4976d3e4b437cf7d0f258d941bfc" + url: "https://pub.dev" + source: hosted + version: "0.9.4+2" + file_selector_platform_interface: + dependency: transitive + description: + name: file_selector_platform_interface + sha256: a3994c26f10378a039faa11de174d7b78eb8f79e4dd0af2a451410c1a5c3f66b + url: "https://pub.dev" + source: hosted + version: "2.6.2" + file_selector_windows: + dependency: transitive + description: + name: file_selector_windows + sha256: "320fcfb6f33caa90f0b58380489fc5ac05d99ee94b61aa96ec2bff0ba81d3c2b" + url: "https://pub.dev" + source: hosted + version: "0.9.3+4" firebase_core: dependency: transitive description: @@ -150,6 +190,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.2" + flutter_plugin_android_lifecycle: + dependency: transitive + description: + name: flutter_plugin_android_lifecycle + sha256: "9ee02950848f61c4129af3d6ec84a1cfc0e47931abc746b03e7a3bc3e8ff6eda" + url: "https://pub.dev" + source: hosted + version: "2.0.22" flutter_secure_storage: dependency: "direct main" description: @@ -240,6 +288,70 @@ packages: url: "https://pub.dev" source: hosted version: "4.0.2" + image_picker: + dependency: "direct main" + description: + name: image_picker + sha256: "021834d9c0c3de46bf0fe40341fa07168407f694d9b2bb18d532dc1261867f7a" + url: "https://pub.dev" + source: hosted + version: "1.1.2" + image_picker_android: + dependency: transitive + description: + name: image_picker_android + sha256: "8c5abf0dcc24fe6e8e0b4a5c0b51a5cf30cefdf6407a3213dae61edc75a70f56" + url: "https://pub.dev" + source: hosted + version: "0.8.12+12" + image_picker_for_web: + dependency: transitive + description: + name: image_picker_for_web + sha256: "717eb042ab08c40767684327be06a5d8dbb341fe791d514e4b92c7bbe1b7bb83" + url: "https://pub.dev" + source: hosted + version: "3.0.6" + image_picker_ios: + dependency: transitive + description: + name: image_picker_ios + sha256: "05da758e67bc7839e886b3959848aa6b44ff123ab4b28f67891008afe8ef9100" + url: "https://pub.dev" + source: hosted + version: "0.8.12+2" + image_picker_linux: + dependency: transitive + description: + name: image_picker_linux + sha256: "34a65f6740df08bbbeb0a1abd8e6d32107941fd4868f67a507b25601651022c9" + url: "https://pub.dev" + source: hosted + version: "0.2.1+2" + image_picker_macos: + dependency: transitive + description: + name: image_picker_macos + sha256: "1b90ebbd9dcf98fb6c1d01427e49a55bd96b5d67b8c67cf955d60a5de74207c1" + url: "https://pub.dev" + source: hosted + version: "0.2.1+2" + image_picker_platform_interface: + dependency: transitive + description: + name: image_picker_platform_interface + sha256: "886d57f0be73c4b140004e78b9f28a8914a09e50c2d816bdd0520051a71236a0" + url: "https://pub.dev" + source: hosted + version: "2.10.1" + image_picker_windows: + dependency: transitive + description: + name: image_picker_windows + sha256: "6ad07afc4eb1bc25f3a01084d28520496c4a3bb0cb13685435838167c9dcedeb" + url: "https://pub.dev" + source: hosted + version: "0.2.1+1" js: dependency: transitive description: @@ -304,6 +416,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.12.0" + mime: + dependency: transitive + description: + name: mime + sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" + url: "https://pub.dev" + source: hosted + version: "2.0.0" path: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 6443fd1..058bd9b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -19,6 +19,7 @@ dependencies: fluttertoast: ^8.1.2 flutter_secure_storage: ^9.0.0 firebase_messaging: ^14.9.1 + image_picker: ^1.1.2 dev_dependencies: flutter_test: diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 39cedd3..8e326bc 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -6,10 +6,13 @@ #include "generated_plugin_registrant.h" +#include #include #include void RegisterPlugins(flutter::PluginRegistry* registry) { + FileSelectorWindowsRegisterWithRegistrar( + registry->GetRegistrarForPlugin("FileSelectorWindows")); FirebaseCorePluginCApiRegisterWithRegistrar( registry->GetRegistrarForPlugin("FirebaseCorePluginCApi")); FlutterSecureStorageWindowsPluginRegisterWithRegistrar( diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 1f5d05f..754248f 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -3,6 +3,7 @@ # list(APPEND FLUTTER_PLUGIN_LIST + file_selector_windows firebase_core flutter_secure_storage_windows )