diff --git a/android/app/build.gradle b/android/app/build.gradle index 7ca9b8d..35afaf0 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -26,6 +26,7 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { + compileSdkVersion 33 compileSdkVersion flutter.compileSdkVersion ndkVersion flutter.ndkVersion @@ -47,7 +48,8 @@ android { applicationId "com.example.project" // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. - minSdkVersion flutter.minSdkVersion + // minSdkVersion flutter.minSdkVersion + minSdkVersion 22 targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName diff --git a/lib/Components/custom_text_form_field.dart b/lib/Components/custom_text_form_field.dart index 38e3ed6..03291b1 100644 --- a/lib/Components/custom_text_form_field.dart +++ b/lib/Components/custom_text_form_field.dart @@ -23,6 +23,16 @@ class _CustomTextFieldState extends State { String? _errorText; //should be null if the input is valid or in initial state bool passwordVisible = false; + bool isPassword({required String label}) { + if (label == "Password" || + label == "Enter a new password" || + label == "Confirm your password") { + return true; + } else { + return false; + } + } + void validate({required String inputValue}) { _errorText = widget.validatorFunc( inputValue: @@ -46,17 +56,15 @@ class _CustomTextFieldState extends State { }); }, icon: passwordVisible - ? const Icon(Icons.visibility_off) - : const Icon(Icons.visibility), + ? const Icon(Icons.visibility) + : const Icon(Icons.visibility_off), color: iconColorTheme(context), )); } List showIcons() { List suffixIcons = []; - if (widget.label == "Password" || - widget.label == "Enter a new password" || - widget.label == "Confirm your password") { + if (isPassword(label: widget.label)) { suffixIcons.add(passwordIcons()); } if (_isValid != 0) { @@ -86,7 +94,7 @@ class _CustomTextFieldState extends State { }, cursorHeight: 30.0, cursorColor: Colors.lightBlue[700], - obscureText: widget.label == 'Password' ? !passwordVisible : false, + obscureText: isPassword(label: widget.label) ? !passwordVisible : false, maxLength: widget.label == 'Name' ? 50 : null, decoration: InputDecoration( prefix: widget.label == "Username" ? const Text("@") : null, diff --git a/lib/Components/custom_toast.dart b/lib/Components/custom_toast.dart new file mode 100644 index 0000000..acae23e --- /dev/null +++ b/lib/Components/custom_toast.dart @@ -0,0 +1,46 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_svg/svg.dart'; + +class CustomToast extends StatelessWidget { + const CustomToast({super.key, required this.message, this.screenWidth}); + final String message; + final double? screenWidth; + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 10), + decoration: BoxDecoration( + color: const Color.fromARGB(180, 0, 0, 0), + borderRadius: BorderRadius.circular(20), + ), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + SvgPicture.asset( + 'assets/images/logo.svg', + alignment: Alignment.centerLeft, + width: 20, + ), + Padding( + padding: const EdgeInsets.only(left: 8.0), + child: Container( + constraints: BoxConstraints( + maxWidth: MediaQuery.of(context).size.width * 0.6, + ), + child: Text( + message, + textAlign: TextAlign.center, + overflow: TextOverflow.clip, + style: const TextStyle( + color: Colors.white, + fontSize: 16, + ), + ), + ), + ), + ], + ), + ); + } +} \ No newline at end of file diff --git a/lib/Components/custom_web_toast.dart b/lib/Components/custom_web_toast.dart new file mode 100644 index 0000000..6cd20f4 --- /dev/null +++ b/lib/Components/custom_web_toast.dart @@ -0,0 +1,33 @@ +import 'package:flutter/material.dart'; + +class CustomWebToast extends StatelessWidget { + const CustomWebToast({super.key, required this.message}); + final String message; + + @override + Widget build(BuildContext context) { + return Container( + alignment: Alignment.topCenter, + margin: EdgeInsets.only( + top: MediaQuery.of(context).size.height * 0.88, + left: MediaQuery.of(context).size.width * 0.37, + right: MediaQuery.of(context).size.width * 0.37, + bottom: MediaQuery.of(context).size.height * 0.03, + ), + padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 10), + decoration: BoxDecoration( + color: Colors.blue, + borderRadius: BorderRadius.circular(5), + ), + child: Text( + textAlign: TextAlign.center, + message, + overflow: TextOverflow.clip, + style: const TextStyle( + color: Colors.white, + fontSize: 15, + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/Components/sign_choose.dart b/lib/Components/sign_choose.dart index 316d607..125be49 100644 --- a/lib/Components/sign_choose.dart +++ b/lib/Components/sign_choose.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:sign_button/sign_button.dart'; import 'package:tweaxy/components/sign_in_with.dart'; import 'package:tweaxy/components/start_screen_divider.dart'; +import 'package:tweaxy/services/sign_in.dart'; class SignChoose extends StatelessWidget { const SignChoose({ @@ -41,6 +42,8 @@ class SignChoose extends StatelessWidget { type: !isDarkMode ? ButtonType.github : ButtonType.githubDark, onPressed: () { //TODO: implement continue with github logic + var res = SignInServices.signInGithub(); + // print("sign in" + res.toString()); }, size: ButtonSize.medium, ), diff --git a/lib/Components/start_screen_signup_button.dart b/lib/Components/start_screen_signup_button.dart index f3b3b1f..8b23879 100644 --- a/lib/Components/start_screen_signup_button.dart +++ b/lib/Components/start_screen_signup_button.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/foundation.dart' show kIsWeb; +import 'package:tweaxy/Views/login/reset_password/reset_password_web.dart'; import 'package:tweaxy/views/signup/create_account_web_view.dart'; import 'package:tweaxy/constants.dart'; diff --git a/lib/Views/login/forget_passwoed_web_1.dart b/lib/Views/login/forget_passwoed_web_1.dart index 74bfb99..b96f5b0 100644 --- a/lib/Views/login/forget_passwoed_web_1.dart +++ b/lib/Views/login/forget_passwoed_web_1.dart @@ -1,26 +1,30 @@ import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; +import 'package:oktoast/oktoast.dart'; import 'package:tweaxy/Views/login/forget_passwoed_web_3.dart'; import 'package:tweaxy/components/custom_button.dart'; import 'package:tweaxy/components/custom_dialog_app_bar.dart'; import 'package:tweaxy/components/custom_text_form_field.dart'; +import 'package:tweaxy/components/custom_web_toast.dart'; +import 'package:tweaxy/components/sign_choose.dart'; +import 'package:tweaxy/components/text_and_link.dart'; +import 'package:tweaxy/constants.dart'; import 'package:tweaxy/services/sign_in.dart'; import 'package:tweaxy/utilities/custom_text_form_validations.dart'; import 'package:tweaxy/utilities/theme_validations.dart'; -import 'package:tweaxy/views/login/forget_passwoed_web_2.dart'; +// ignore: must_be_immutable class ForgetPasswordWeb1 extends StatefulWidget { - const ForgetPasswordWeb1({super.key}); + ForgetPasswordWeb1({super.key}); @override - State createState() => _ForgetPasswordWeb1State(); + State createState() => _WebDialogSignInPage2State(); } -class _ForgetPasswordWeb1State extends State { +class _WebDialogSignInPage2State extends State { TextEditingController myController = TextEditingController(); bool isButtonEnabled = false; bool isSnackBarShown = false; // Added flag to track SnackBar visibility - @override void initState() { super.initState(); @@ -45,7 +49,7 @@ class _ForgetPasswordWeb1State extends State { mainAxisAlignment: MainAxisAlignment.center, children: [ CustomDialogAppBar(isDarkMode: isDarkMode), - Padding( + const Padding( padding: const EdgeInsets.only(left: 50), child: Row( children: [ @@ -95,22 +99,23 @@ class _ForgetPasswordWeb1State extends State { padding: const EdgeInsets.only(top: 12.0), child: SizedBox( width: 500, - height: 50, + height: 40, child: CustomButton( color: forgroundColorTheme(context), text: 'Login', onPressedCallback: () async { - SignInServices forgetPass = SignInServices(Dio()); - String res = await forgetPass.forgetPasswordEmail( - email: myController.text); + SignInServices.setEmail(email: myController.text); + String res = + await SignInServices.forgetPassword(); + print(res); if (res != 'success') { - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text('$res'), - backgroundColor: Colors.blue, - ), - ); + showToastWidget( + CustomWebToast( + message: res, + ), + position: ToastPosition.bottom, + duration: const Duration(seconds: 2)); } else { Navigator.pop(context); @@ -127,6 +132,7 @@ class _ForgetPasswordWeb1State extends State { }, initialEnabled: isButtonEnabled)), ), + Container(height: 30) ], ), ), diff --git a/lib/Views/login/forget_passwoed_web_2.dart b/lib/Views/login/forget_passwoed_web_2.dart index c9e2d0f..74595c7 100644 --- a/lib/Views/login/forget_passwoed_web_2.dart +++ b/lib/Views/login/forget_passwoed_web_2.dart @@ -76,11 +76,8 @@ class ForgetPasswordWeb2 extends StatelessWidget { color: forgroundColorTheme(context), text: 'Next', onPressedCallback: () async { - SignInServices forgetPass = - await SignInServices(Dio()); + String res = SignInServices.forgetPassword(); - Future res = - forgetPass.forgetPasswordEmail(email: email); if (res != 'sucess') { ScaffoldMessenger.of(scaffoldContext) .showSnackBar( diff --git a/lib/Views/login/forget_passwoed_web_3.dart b/lib/Views/login/forget_passwoed_web_3.dart index 41f7d25..c8011ab 100644 --- a/lib/Views/login/forget_passwoed_web_3.dart +++ b/lib/Views/login/forget_passwoed_web_3.dart @@ -1,16 +1,39 @@ import 'package:flutter/material.dart'; +import 'package:tweaxy/Views/login/reset_password/reset_password_web.dart'; import 'package:tweaxy/components/custom_button.dart'; import 'package:tweaxy/components/custom_dialog_app_bar.dart'; import 'package:tweaxy/components/custom_text_form_field.dart'; import 'package:tweaxy/utilities/custom_text_form_validations.dart'; import 'package:tweaxy/utilities/theme_validations.dart'; +import 'package:tweaxy/views/login/forget_passwoed_web_1.dart'; -class ForgetPasswordWeb3 extends StatelessWidget { +import '../../services/sign_in.dart'; + +class ForgetPasswordWeb3 extends StatefulWidget { const ForgetPasswordWeb3({super.key}); + @override + State createState() => _ForgetPasswordWeb3State(); +} + +class _ForgetPasswordWeb3State extends State { + bool isButtonEnabled = false; + TextEditingController myController = TextEditingController(); + + @override + void initState() { + super.initState(); + myController.addListener(_updateButtonState); + } + + void _updateButtonState() { + setState(() { + isButtonEnabled = myController.text.isNotEmpty; + }); + } + @override Widget build(BuildContext context) { - TextEditingController myController = TextEditingController(); bool isDarkMode = MediaQuery.of(context).platformBrightness == Brightness.dark; return SizedBox( @@ -55,7 +78,7 @@ class ForgetPasswordWeb3 extends StatelessWidget { padding: const EdgeInsets.symmetric(horizontal: 15.0), child: CustomTextField( key: const ValueKey("forgetPassView3TextField"), - validatorFunc: emailValidation, + validatorFunc: codeValidation, label: 'Enter your code', controller: myController, ), @@ -67,18 +90,34 @@ class ForgetPasswordWeb3 extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.end, children: [ SizedBox( - height: 50, - width: 350, - child: CustomButton( - key: const ValueKey("forgetPassView3BackButton"), - color: backgroundColorTheme(context), - text: 'Back', - initialEnabled: true, - onPressedCallback: () { - Navigator.pop(context); - }, - ), - ), + height: 50, + width: 350, + child: CustomButton( + key: const ValueKey("forgetPassView3BackButton"), + color: isButtonEnabled + ? forgroundColorTheme(context) + : backgroundColorTheme(context), + text: isButtonEnabled ? 'Next' : 'Back', + initialEnabled: true, + onPressedCallback: () { + if (isButtonEnabled) + SignInServices.setToken( + token: myController.text); + + Navigator.pop(context); + showDialog( + context: context, + builder: (context) => AlertDialog( + content: isButtonEnabled + ? ResetPasswordWeb() + : ForgetPasswordWeb1(), + ), + barrierColor: + const Color.fromARGB(100, 97, 119, 129), + barrierDismissible: false, + ); + }, + )), ]), ), ) diff --git a/lib/Views/login/reset_password/reset_password_mobile.dart b/lib/Views/login/reset_password/reset_password_mobile.dart new file mode 100644 index 0000000..314b469 --- /dev/null +++ b/lib/Views/login/reset_password/reset_password_mobile.dart @@ -0,0 +1,185 @@ +import 'package:flutter/material.dart'; +import 'package:fluttertoast/fluttertoast.dart'; +import 'package:tweaxy/Components/custom_head_text.dart'; +import 'package:tweaxy/Components/custom_paragraph_text.dart'; +import 'package:tweaxy/Views/login/reset_password/reset_password_mobile2.dart'; +import 'package:tweaxy/components/custom_appbar.dart'; +import 'package:tweaxy/components/custom_button.dart'; +import 'package:tweaxy/components/custom_text_form_field.dart'; +import 'package:tweaxy/components/transition/custom_page_route.dart'; +import 'package:tweaxy/services/sign_in.dart'; +import 'package:tweaxy/utilities/custom_text_form_validations.dart'; +import 'package:tweaxy/utilities/theme_validations.dart'; +import 'package:tweaxy/views/login/forget_password_page1.dart'; + +// ignore: must_be_immutable +class ResetPasswordMobile extends StatefulWidget { + const ResetPasswordMobile({super.key}); + + @override + State createState() => _ResetPasswordMobileState(); +} + +class _ResetPasswordMobileState extends State { + TextEditingController myControllerNewPassword = TextEditingController(); + TextEditingController myControllerConfirmPassword = TextEditingController(); + + bool isButtonEnabled = false; + bool isValidPass = false; + @override + void initState() { + super.initState(); + myControllerNewPassword.addListener(_updateButtonState); + myControllerConfirmPassword.addListener(_updateButtonState); + } + + void _updateButtonState() { + setState(() { + String c1 = myControllerNewPassword.text; + String c2 = myControllerConfirmPassword.text; + if (!myControllerNewPassword.text.isEmpty && (c1 == c2)) + isButtonEnabled = true; + else + isButtonEnabled = false; + }); + } + + @override + Widget build(BuildContext context) { + double screenwidth = MediaQuery.of(context).size.width; + double screenheight = MediaQuery.of(context).size.height; + + bool isDarkMode = + MediaQuery.of(context).platformBrightness == Brightness.dark; + return Scaffold( + appBar: CustomAppbar( + iconButton: IconButton( + key: const ValueKey("ResetPasswordMobileBackIcon"), + icon: const Icon( + Icons.close_sharp, + color: Colors.black, + ), + onPressed: () { + Navigator.pop(context); + }, + ), + ), + body: SingleChildScrollView( + child: Column( + children: [ + SizedBox( + height: MediaQuery.of(context).size.height * 0.78, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Padding( + padding: EdgeInsets.only(left: 15), + child: Text( + 'Choose a new\npassword', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 35, + ), + ), + ), + Container( + padding: EdgeInsets.only( + bottom: screenheight * 0.05, + top: screenheight * 0.03, + left: screenwidth * 0.04, + right: screenwidth * 0.08, + ), + child: RichText( + text: const TextSpan( + text: + "Make sure your new password is 8 characters or more. Try including numbers, letters, and punctuation marks for a", + style: TextStyle( + fontWeight: FontWeight.w400, + fontSize: 20, + color: Colors.black54), + children: [ + TextSpan( + text: ' strong password', + style: TextStyle( + fontWeight: FontWeight.w400, + fontSize: 20, + color: Colors.blue)), + ], + ), + )), + Padding( + padding: EdgeInsets.only( + bottom: screenheight * 0.06, + left: screenwidth * 0.04, + right: screenwidth * 0.04, + ), + child: CustomTextField( + key: const ValueKey("ResetPasswordMobileNewPass"), + label: "Enter a new password", + validatorFunc: passwordValidation, + controller: myControllerNewPassword, + ), + ), + Padding( + padding: EdgeInsets.only( + bottom: screenheight * 0.06, + left: screenwidth * 0.04, + right: screenwidth * 0.04, + ), + child: CustomTextField( + key: const ValueKey("ResetPasswordMobileConfirmPass"), + label: "Confirm your password", + validatorFunc: passwordValidation, + controller: myControllerConfirmPassword, + ), + ), + ], + ), + ), + SizedBox( + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + const Divider(), + Align( + alignment: Alignment.bottomRight, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: CustomButton( + key: const ValueKey( + "ResetPasswordMobileChangePassButton"), + color: forgroundColorTheme(context), + text: 'Change Password', + initialEnabled: isButtonEnabled, + onPressedCallback: () async { + String res = await SignInServices.resetPassword( + myControllerNewPassword.text); + if (res != 'success') { + Fluttertoast.showToast( + msg: '$res', + toastLength: Toast.LENGTH_SHORT, + timeInSecForIosWeb: 2, + backgroundColor: Colors.blue, + textColor: Colors.white, + fontSize: 16.0, + ); + } else { + Navigator.pop(context); + Navigator.push( + context, + CustomPageRoute( + direction: AxisDirection.left, + child: ResetPasswordMobile2())); + } + }, + ), + ), + ), + ], + ), + ), + ], + ), + )); + } +} diff --git a/lib/Views/login/reset_password/reset_password_mobile2.dart b/lib/Views/login/reset_password/reset_password_mobile2.dart new file mode 100644 index 0000000..fafd569 --- /dev/null +++ b/lib/Views/login/reset_password/reset_password_mobile2.dart @@ -0,0 +1,103 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_svg/svg.dart'; +import 'package:tweaxy/Components/custom_head_text.dart'; +import 'package:tweaxy/Components/custom_paragraph_text.dart'; +import 'package:tweaxy/components/custom_appbar.dart'; +import 'package:tweaxy/components/custom_button.dart'; +import 'package:tweaxy/components/custom_text_form_field.dart'; +import 'package:tweaxy/components/transition/custom_page_route.dart'; +import 'package:tweaxy/utilities/custom_text_form_validations.dart'; +import 'package:tweaxy/utilities/theme_validations.dart'; +import 'package:tweaxy/views/login/forget_password_page1.dart'; + +// ignore: must_be_immutable +class ResetPasswordMobile2 extends StatefulWidget { + const ResetPasswordMobile2({super.key}); + + @override + State createState() => _ResetPasswordMobile2State(); +} + +class _ResetPasswordMobile2State extends State { + @override + Widget build(BuildContext context) { + double screenwidth = MediaQuery.of(context).size.width; + double screenheight = MediaQuery.of(context).size.height; + + return Scaffold( + appBar: AppBar( + backgroundColor: Colors.transparent, + elevation: 0, + flexibleSpace: Center( + child: SafeArea( + child: SvgPicture.asset( + 'assets/images/logo.svg', + alignment: Alignment.center, + ), + ), + ), + ), + body: SingleChildScrollView( + child: Column( + children: [ + SizedBox( + height: MediaQuery.of(context).size.height * 0.78, + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Padding( + padding: EdgeInsets.only( + right: screenwidth * 0.3, + top: screenheight * 0.1, + ), + child: Text( + 'You\'re all set', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 35, + ), + ), + ), + Padding( + padding: EdgeInsets.only( + left: screenwidth * 0.1, bottom: screenheight * 0.05), + child: CustomParagraphText( + textValue: + 'You\'ve successfully changed your password', + textAlign: TextAlign.left), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: SizedBox( + width: screenwidth - screenwidth * 0.2, + child: CustomButton( + key: const ValueKey("ContinueToXButtonMobile"), + color: forgroundColorTheme(context), + text: 'Continue to X', + initialEnabled: true, + onPressedCallback: () { + Navigator.pop(context); + }, + ), + ), + ), + ], + ), + ), + // SizedBox( + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.end, + // children: [ + // const Divider(), + // Align( + // alignment: Alignment.bottomRight, + // child: + // ), + // ], + // ), + // ), + ], + ), + )); + } +} diff --git a/lib/Views/login/reset_password/reset_password_web.dart b/lib/Views/login/reset_password/reset_password_web.dart new file mode 100644 index 0000000..1c9ec53 --- /dev/null +++ b/lib/Views/login/reset_password/reset_password_web.dart @@ -0,0 +1,158 @@ +import 'package:flutter/material.dart'; +import 'package:tweaxy/Components/custom_dialog_app_bar.dart'; +import 'package:tweaxy/Views/login/reset_password/reset_password_web2.dart'; +import 'package:tweaxy/components/custom_appbar_web.dart'; +import 'package:tweaxy/components/custom_button.dart'; +import 'package:tweaxy/components/custom_head_text.dart'; +import 'package:tweaxy/components/custom_paragraph_text.dart'; +import 'package:tweaxy/components/custom_text_form_field.dart'; +import 'package:tweaxy/services/sign_in.dart'; +import 'package:tweaxy/utilities/custom_text_form_validations.dart'; +import 'package:tweaxy/utilities/theme_validations.dart'; + +class ResetPasswordWeb extends StatefulWidget { + const ResetPasswordWeb({super.key}); + + @override + State createState() => _ResetPasswordWebState(); +} + +class _ResetPasswordWebState extends State { + TextEditingController myControllerNewPassword = TextEditingController(); + TextEditingController myControllerConfirmPassword = TextEditingController(); + + bool isButtonEnabled = false; + @override + void initState() { + super.initState(); + myControllerNewPassword.addListener(_updateButtonState); + myControllerConfirmPassword.addListener(_updateButtonState); + } + + void _updateButtonState() { + setState(() { + String c1 = myControllerNewPassword.text; + String c2 = myControllerConfirmPassword.text; + if (!myControllerNewPassword.text.isEmpty && (c1 == c2)) + isButtonEnabled = true; + else + isButtonEnabled = false; + }); + } + + @override + Widget build(BuildContext context) { + double screenwidth = MediaQuery.of(context).size.width; + double screenheight = MediaQuery.of(context).size.height; + + return SizedBox( + width: MediaQuery.of(context).size.width * 0.4, + child: Column( + children: [ + CustomDialogAppBar(isDarkMode: true), + Padding( + padding: EdgeInsets.only( + left: screenwidth * 0.02, + right: screenwidth * 0.02, + top: screenheight * 0.01), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + CustomHeadText( + size: 35, + textValue: 'Choose a new password', + textAlign: TextAlign.left, + ), + Padding( + padding: EdgeInsets.symmetric( + vertical: MediaQuery.of(context).size.height * 0.02), + child: RichText( + text: const TextSpan( + text: + "Make sure your new password is 8 characters or more. Try including numbers, letters, and punctuation marks for a", + style: TextStyle( + fontWeight: FontWeight.w400, + fontSize: 17, + color: Colors.black54), + children: [ + TextSpan( + text: ' strong password', + style: TextStyle( + fontWeight: FontWeight.w400, + fontSize: 17, + color: Colors.blue)), + ], + ), + ), + ), + Padding( + padding: EdgeInsets.only( + top: screenheight * 0.02, + bottom: screenheight * 0.04, + ), + child: CustomTextField( + key: const ValueKey("ResetPasswordWebNewPass"), + label: "Enter a new password", + validatorFunc: passwordValidation, + controller: myControllerNewPassword, + ), + ), + Padding( + padding: EdgeInsets.only( + bottom: screenheight * 0.03, + ), + child: CustomTextField( + key: const ValueKey("ResetPasswordWebConfirmPass"), + label: "Confirm your password", + validatorFunc: passwordValidation, + controller: myControllerConfirmPassword, + ), + ), + ], + ), + ), + Column( + // crossAxisAlignment: CrossAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Padding( + padding: EdgeInsets.only(top: screenheight * 0.21), + child: SizedBox( + width: 500, + height: 50, + child: CustomButton( + key: const ValueKey("ResetPasswordWebNext"), + color: forgroundColorTheme(context), + text: 'Change Password', + onPressedCallback: () async { + String res = await SignInServices.resetPassword( + myControllerNewPassword.text); + if (res != 'success') { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text('$res'), + backgroundColor: Colors.blue, + ), + ); + } else { + Navigator.pop(context); + showDialog( + context: context, + builder: (context) => AlertDialog( + content: ResetPasswordWeb2(), + ), + barrierColor: + const Color.fromARGB(100, 97, 119, 129), + barrierDismissible: false, + ); + } + }, + initialEnabled: isButtonEnabled)), + ), + ], + ) + ], + ), + ); + } +} diff --git a/lib/Views/login/reset_password/reset_password_web2.dart b/lib/Views/login/reset_password/reset_password_web2.dart new file mode 100644 index 0000000..03735fa --- /dev/null +++ b/lib/Views/login/reset_password/reset_password_web2.dart @@ -0,0 +1,78 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_svg/svg.dart'; +import 'package:tweaxy/Components/custom_dialog_app_bar.dart'; +import 'package:tweaxy/components/custom_appbar_web.dart'; +import 'package:tweaxy/components/custom_button.dart'; +import 'package:tweaxy/components/custom_head_text.dart'; +import 'package:tweaxy/components/custom_paragraph_text.dart'; +import 'package:tweaxy/components/custom_text_form_field.dart'; +import 'package:tweaxy/utilities/custom_text_form_validations.dart'; +import 'package:tweaxy/utilities/theme_validations.dart'; + +class ResetPasswordWeb2 extends StatefulWidget { + const ResetPasswordWeb2({super.key}); + + @override + State createState() => _ResetPasswordWeb2State(); +} + +class _ResetPasswordWeb2State extends State { + @override + Widget build(BuildContext context) { + double screenwidth = MediaQuery.of(context).size.width; + double screenheight = MediaQuery.of(context).size.height; + + return SizedBox( + width: MediaQuery.of(context).size.width * 0.4, + child: Column( + children: [ + AppBar( + elevation: 0, + backgroundColor: Colors.white, + centerTitle: true, + title: SvgPicture.asset( + width: 50, + height: 50, + 'assets/images/logo.svg', + fit: BoxFit.cover, + ), + ), + Padding( + padding: EdgeInsets.only( + top: screenheight * 0.04, right: screenwidth * 0.08), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + CustomHeadText( + size: 35, + textValue: 'You\'re all set', + textAlign: TextAlign.left, + ), + Padding( + padding: EdgeInsets.symmetric( + vertical: MediaQuery.of(context).size.height * 0.02), + child: CustomParagraphText( + textValue: 'You\'ve successfully changed your password', + textAlign: TextAlign.left)), + ], + ), + ), + Padding( + padding: EdgeInsets.only(top: screenheight * 0.21), + child: SizedBox( + width: 500, + height: 50, + child: CustomButton( + key: const ValueKey("ContinueToXButtonWeb"), + color: forgroundColorTheme(context), + text: 'Continue to X', + onPressedCallback: () async { + Navigator.pop(context); + }, + initialEnabled: true)), + ), + ], + ), + ); + } +} diff --git a/lib/Views/login/web_dialog_sign_in.dart b/lib/Views/login/web_dialog_sign_in.dart index cd224ea..802929b 100644 --- a/lib/Views/login/web_dialog_sign_in.dart +++ b/lib/Views/login/web_dialog_sign_in.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:tweaxy/Views/login/reset_password/reset_password_web.dart'; import 'package:tweaxy/components/custom_button.dart'; import 'package:tweaxy/components/custom_dialog_app_bar.dart'; import 'package:tweaxy/components/custom_text_form_field.dart'; diff --git a/lib/helpers/api.dart b/lib/helpers/api.dart index 1195254..d3d2669 100644 --- a/lib/helpers/api.dart +++ b/lib/helpers/api.dart @@ -2,7 +2,7 @@ import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; class Api { - static Future get(String url) async { + static Future get(String url) async { Response response; try { response = await Dio().get(url); @@ -13,7 +13,7 @@ class Api { 'There\'s an error status code = ${response.statusCode} \nThe message is ${response.statusMessage}'); } } on Exception catch (e) { - throw Exception(e.toString()); + return (e.toString()); } } diff --git a/lib/main.dart b/lib/main.dart index b89aa07..3caac65 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:oktoast/oktoast.dart'; import 'package:tweaxy/views/signup/authentication_view.dart'; import 'package:tweaxy/views/signup/not_robot_view.dart'; import 'package:tweaxy/constants.dart'; @@ -23,24 +24,26 @@ class TweaXy extends StatelessWidget { Widget build(BuildContext context) { var brightness = MediaQuery.of(context).platformBrightness; bool isDarkMode = brightness == Brightness.dark; - return MaterialApp( - debugShowCheckedModeBanner: false, - theme: ThemeData( - brightness: brightness, - fontFamily: 'Roboto', - scaffoldBackgroundColor: isDarkMode ? Colors.black : Colors.white, - dialogBackgroundColor: isDarkMode ? Colors.black : Colors.white, + return OKToast( + child: MaterialApp( + debugShowCheckedModeBanner: false, + theme: ThemeData( + brightness: brightness, + fontFamily: 'Roboto', + scaffoldBackgroundColor: isDarkMode ? Colors.black : Colors.white, + dialogBackgroundColor: isDarkMode ? Colors.black : Colors.white, + ), + routes: { + kSplashScreen: (context) => const SplashScreen(), + kStartScreen: (context) => const StartScreen(), + kWebStartScreen: (context) => const WebStartScreen(), + kLogin1Screen: (context) => const LoginViewPage1(), + kCreateAcountScreen: (context) => const CreateAccountView(), + kCreateAcountWebScreen: (context) => const CreateAccountWebView(), + kAuthenticationScreen: (context) => const AuthenticationView(), + }, + initialRoute: kSplashScreen, ), - routes: { - kSplashScreen: (context) => const SplashScreen(), - kStartScreen: (context) => const StartScreen(), - kWebStartScreen: (context) => const WebStartScreen(), - kLogin1Screen: (context) => const LoginViewPage1(), - kCreateAcountScreen: (context) => const CreateAccountView(), - kCreateAcountWebScreen: (context) => const CreateAccountWebView(), - kAuthenticationScreen: (context) => const AuthenticationView(), - }, - initialRoute: kSplashScreen, ); } } diff --git a/lib/services/sign_in.dart b/lib/services/sign_in.dart index 02823bd..35e705a 100644 --- a/lib/services/sign_in.dart +++ b/lib/services/sign_in.dart @@ -1,17 +1,28 @@ import 'package:dio/dio.dart'; import 'package:flutter/foundation.dart' show kIsWeb; import 'package:tweaxy/helpers/api.dart'; +import 'package:url_launcher/url_launcher.dart'; +// import 'package:google_sign_in/google_sign_in.dart'; class SignInServices { - String baseUrl = kIsWeb - ? 'http://localhost:3000/api/v1' - : 'http://192.168.1.31:3000/api/v1'; + SignInServices._(); + static SignInServices? _instance; + static String email = ''; + // http://16.171.65.142:3000/api/v1/docs/ + static String token = ''; //code sent to email + static String baseUrl = kIsWeb + ? 'http://16.171.65.142:3000/api/v1' + : 'http://16.171.65.142:3000/api/v1'; // String baseUrl = 'http://localhost:3000/api/v1'; + static void setEmail({required String email}) { + SignInServices.email = email; + } - final Dio dio; - SignInServices(this.dio); + static void setToken({required String token}) { + SignInServices.token = token; + } - dynamic forgetPasswordEmail({required String email}) async { + static dynamic forgetPassword() async { print(email); var res = await Api.post( body: {'UUID': email}, @@ -22,39 +33,65 @@ class SignInServices { return res; else return "success"; - // Response? response; - // Binary data - // try { - // response = await dio.post( - // '$baseUrl/auth/forgetPassword', - // data: {'UUID': email}, - // ); - // print(response.data); - // return 'success'; - // } on DioException catch (e) { - // print(response); - // // var res = e.response!; - // // print(res.extra); - // // print("mmmmmm=" + res.extra['message'].toString()); - // // final String errorMessage = - // // e.response?.data['error']['message'] ?? res == 403 - // // ? "email or phone or username is required field" - // // : res == 404 - // // ? "User not found" - // // : res == 429 - // // ? "More than one request in less than 30 seconds" - // // : "oops there is an error, try again later"; - // return e.response!.statusMessage!; - // // if (res == 403) - // // return "email or phone or username is required field"; - // // else if (res == 404) - // // return "User not found"; - // // else if (res == 429) - // // return "More than one request in less than 30 seconds"; - // // else - // // return "oops there is an error, try again later"; - // } catch (e) { - // return "oops there is an error, try again later"; - // } } + + static dynamic resetPassword(String password) async { + var res = await Api.post( + url: '$baseUrl/auth/resetPassword/$email/$token', + body: {"password": password}, + ); + print('reset' + res.toString()); + if (res is String) + return res; + else + return "success"; + } + + static Future signInGithub() async { + String _url = Uri.encodeFull( + 'http://ec2-16-171-65-142.eu-north-1.compute.amazonaws.com:3000/api/v1/auth/github/callback'); + if (await canLaunch(_url)) { + await launch(_url, forceWebView: true); + Response res = await Api.get( + 'http://ec2-16-171-65-142.eu-north-1.compute.amazonaws.com:3000/api/v1/auth/github/callback', + ); + print('reset' + res.data); + } else { + print('couldn\'t launch'); + } + return "h"; + } +// static Future _handleDeepLink() async { +// String initialLink; +// try { +// initialLink = await getInitialLink(); +// // Process the returned data from the deep link +// // Example: handleReturnedData(initialLink); +// } catch (e) { +// print(e.toString()); +// } +// } + + // Add your logic to handle the returned data + // void handleReturnedData(String data) { + // // Your implementation here + // } +// } + +// Future signInWithGoogle() async { +// // Trigger the authentication flow +// final GoogleSignInAccount? googleUser = await GoogleSignIn().signIn(); + +// // Obtain the auth details from the request +// final GoogleSignInAuthentication? googleAuth = await googleUser?.authentication; + +// // Create a new credential +// final credential = GoogleAuthProvider.credential( +// accessToken: googleAuth?.accessToken, +// idToken: googleAuth?.idToken, +// ); + +// // Once signed in, return the UserCredential +// return await FirebaseAuth.instance.signInWithCredential(credential); +// } } diff --git a/lib/views/login/forget_password_page1.dart b/lib/views/login/forget_password_page1.dart index ee76b80..0417d1c 100644 --- a/lib/views/login/forget_password_page1.dart +++ b/lib/views/login/forget_password_page1.dart @@ -1,6 +1,9 @@ import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; import 'package:fluttertoast/fluttertoast.dart'; +import 'package:oktoast/oktoast.dart'; +import 'package:tweaxy/Components/custom_toast.dart'; +import 'package:tweaxy/Components/custom_web_toast.dart'; import 'package:tweaxy/components/custom_appbar.dart'; import 'package:tweaxy/components/custom_button.dart'; import 'package:tweaxy/components/transition/custom_page_route.dart'; @@ -103,19 +106,22 @@ class _LoginViewPage1State extends State { text: 'Next', initialEnabled: isButtonEnabled, onPressedCallback: () async { - SignInServices forgetPass = SignInServices(Dio()); - String res = await forgetPass.forgetPasswordEmail( - email: myController.text); + SignInServices.setEmail(email: myController.text); + String res = await SignInServices.forgetPassword(); + print(res); if (res != 'success') { - Fluttertoast.showToast( - msg: '$res', - toastLength: Toast.LENGTH_SHORT, - timeInSecForIosWeb: 1, - backgroundColor: Colors.blue, - textColor: Colors.white, - fontSize: 16.0, - ); + showToastWidget( + CustomToast( + message: res, + ), + // toastLength: Toast.LENGTH_SHORT, + // timeInSecForIosWeb: 1, + // backgroundColor: Colors.blue, + // textColor: Colors.white, + // fontSize: 16.0, + position: ToastPosition.bottom, + duration: const Duration(seconds: 2)); } else { Navigator.pop(context); Navigator.push( diff --git a/lib/views/login/forget_password_page3.dart b/lib/views/login/forget_password_page3.dart index 8734e39..f239fdc 100644 --- a/lib/views/login/forget_password_page3.dart +++ b/lib/views/login/forget_password_page3.dart @@ -1,11 +1,14 @@ import 'package:flutter/material.dart'; +import 'package:tweaxy/Views/login/reset_password/reset_password_mobile.dart'; // import 'package:tweaxy/Views/login/resetpassword/reset_password_mobile.dart'; import 'package:tweaxy/components/custom_appbar.dart'; import 'package:tweaxy/components/custom_button.dart'; import 'package:tweaxy/components/transition/custom_page_route.dart'; import 'package:tweaxy/components/custom_text_form_field.dart'; +import 'package:tweaxy/services/sign_in.dart'; import 'package:tweaxy/utilities/custom_text_form_validations.dart'; import 'package:tweaxy/utilities/theme_validations.dart'; +import 'package:tweaxy/views/login/forget_password_page1.dart'; import 'package:tweaxy/views/login/forget_password_page2.dart'; import 'package:tweaxy/views/login/login_view_page2.dart'; @@ -68,13 +71,12 @@ class _LoginViewPage1State extends State { Padding( padding: const EdgeInsets.only(top: 15.0, left: 15, right: 15), child: Text( - 'Check your phone to get your confirmation code. if you need to requst a new code, go back and reselect a confimation method.', + 'Check your phone to get your confirmation code. if you need to request a new code, go back and reselect a confimation method.', overflow: TextOverflow.fade, style: TextStyle( - fontWeight: FontWeight.w400, - fontSize: 20, - color: !isDarkMode ? Colors.black87 : Colors.white38, - ), + fontWeight: FontWeight.w400, + fontSize: 20, + color: !isDarkMode ? Colors.black45 : Colors.white38), ), ), SizedBox( @@ -84,7 +86,7 @@ class _LoginViewPage1State extends State { padding: const EdgeInsets.symmetric(horizontal: 15.0), child: CustomTextField( key: const ValueKey("forgetPassView3TextField"), - validatorFunc: emailValidation, + validatorFunc: codeValidation, label: 'Enter your code', controller: myController, ), @@ -112,11 +114,11 @@ class _LoginViewPage1State extends State { initialEnabled: true, onPressedCallback: () { Navigator.pop(context); - // Navigator.push( - // context, - // CustomPageRoute( - // direction: AxisDirection.left, - // child: ())); + Navigator.push( + context, + CustomPageRoute( + direction: AxisDirection.left, + child: ForgetPasswordPage1())); }, ), CustomButton( @@ -125,14 +127,13 @@ class _LoginViewPage1State extends State { text: 'Next', initialEnabled: isButtonEnabled, onPressedCallback: () { + SignInServices.setToken(token: myController.text); Navigator.pop(context); Navigator.push( context, CustomPageRoute( direction: AxisDirection.left, - child: LoginViewPage2( - initialValue: myController, - ))); + child: ResetPasswordMobile())); }, ), ], diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index a124bbe..f177591 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -7,9 +7,13 @@ #include "generated_plugin_registrant.h" #include +#include void fl_register_plugins(FlPluginRegistry* registry) { g_autoptr(FlPluginRegistrar) modal_progress_hud_nsn_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "ModalProgressHudNsnPlugin"); modal_progress_hud_nsn_plugin_register_with_registrar(modal_progress_hud_nsn_registrar); + g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); + url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); } diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index f6f1987..812da58 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -4,6 +4,7 @@ list(APPEND FLUTTER_PLUGIN_LIST modal_progress_hud_nsn + url_launcher_linux ) list(APPEND FLUTTER_FFI_PLUGIN_LIST diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index c882df7..7c98944 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -8,9 +8,11 @@ import Foundation import modal_progress_hud_nsn import path_provider_foundation import shared_preferences_foundation +import url_launcher_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { ModalProgressHudNsnPlugin.register(with: registry.registrar(forPlugin: "ModalProgressHudNsnPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) + UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) } diff --git a/pubspec.lock b/pubspec.lock index c71263b..2a8a9e7 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -6,7 +6,7 @@ packages: description: name: args sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.4.2" async: @@ -14,7 +14,7 @@ packages: description: name: async sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.11.0" auto_size_text: @@ -22,7 +22,7 @@ packages: description: name: auto_size_text sha256: "3f5261cd3fb5f2a9ab4e2fc3fba84fd9fcaac8821f20a1d4e71f557521b22599" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.0" boolean_selector: @@ -30,7 +30,7 @@ packages: description: name: boolean_selector sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.1" characters: @@ -38,7 +38,7 @@ packages: description: name: characters sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.0" clock: @@ -46,7 +46,7 @@ packages: description: name: clock sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.1" collection: @@ -54,7 +54,7 @@ packages: description: name: collection sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.17.2" crypto: @@ -62,7 +62,7 @@ packages: description: name: crypto sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.3" cupertino_icons: @@ -70,7 +70,7 @@ packages: description: name: cupertino_icons sha256: d57953e10f9f8327ce64a508a355f0b1ec902193f66288e8cb5070e7c47eeb2d - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.6" datepicker_dropdown: @@ -78,7 +78,7 @@ packages: description: name: datepicker_dropdown sha256: a6ed67be78411369b52d1f84cd9ecc96326a98364171662a2e8e02342d633d3d - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.0.8" dio: @@ -86,7 +86,7 @@ packages: description: name: dio sha256: "417e2a6f9d83ab396ec38ff4ea5da6c254da71e4db765ad737a42af6930140b7" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "5.3.3" dotted_border: @@ -94,7 +94,7 @@ packages: description: name: dotted_border sha256: "108837e11848ca776c53b30bc870086f84b62ed6e01c503ed976e8f8c7df9c04" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" fake_async: @@ -102,7 +102,7 @@ packages: description: name: fake_async sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.1" ffi: @@ -110,7 +110,7 @@ packages: description: name: ffi sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" file: @@ -118,7 +118,7 @@ packages: description: name: file sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "7.0.0" flutter: @@ -131,7 +131,7 @@ packages: description: name: flutter_holo_date_picker sha256: "839ac788e468c8c51a280b3847e4d56e6286bef3a823ba2e81a304564ec59822" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.3" flutter_lints: @@ -139,7 +139,7 @@ packages: description: name: flutter_lints sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.3" flutter_spinkit: @@ -147,17 +147,17 @@ packages: description: name: flutter_spinkit sha256: b39c753e909d4796906c5696a14daf33639a76e017136c8d82bf3e620ce5bb8e - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "5.2.0" flutter_svg: dependency: "direct main" description: name: flutter_svg - sha256: bfc7cc3c75fe1282e8ce2e056d8fd1533f1a6848b65c379b4a5e7a9b623d3371 - url: "https://pub.dev" + sha256: d39e7f95621fc84376bc0f7d504f05c3a41488c562f4a8ad410569127507402c + url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.8" + version: "2.0.9" flutter_test: dependency: "direct dev" description: flutter @@ -172,16 +172,16 @@ packages: dependency: "direct main" description: name: fluttertoast - sha256: "474f7d506230897a3cd28c965ec21c5328ae5605fc9c400cd330e9e9d6ac175c" - url: "https://pub.dev" + sha256: "69a5c4fcfe9a163bc927ff386c0dedd62575913bba942d0ce80c1fd092885255" + url: "https://pub.flutter-io.cn" source: hosted - version: "8.2.2" + version: "8.2.3" google_fonts: dependency: "direct main" description: name: google_fonts sha256: f0b8d115a13ecf827013ec9fc883390ccc0e87a96ed5347a3114cac177ef18e8 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "6.1.0" http: @@ -189,7 +189,7 @@ packages: description: name: http sha256: "759d1a329847dd0f39226c688d3e06a6b8679668e350e2891a6474f8b4bb8525" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" http_parser: @@ -197,7 +197,7 @@ packages: description: name: http_parser sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.2" intl: @@ -205,7 +205,7 @@ packages: description: name: intl sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.18.1" lints: @@ -213,7 +213,7 @@ packages: description: name: lints sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.1" loading_indicator: @@ -221,7 +221,7 @@ packages: description: name: loading_indicator sha256: a101ffb2aa3e646137d7810bfa90b50525dd3f72c01235b6df7491cf6af6f284 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.1.1" matcher: @@ -229,7 +229,7 @@ packages: description: name: matcher sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.12.16" material_color_utilities: @@ -237,7 +237,7 @@ packages: description: name: material_color_utilities sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.5.0" meta: @@ -245,7 +245,7 @@ packages: description: name: meta sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.9.1" mime: @@ -253,7 +253,7 @@ packages: description: name: mime sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.4" modal_progress_hud_nsn: @@ -261,15 +261,23 @@ packages: description: name: modal_progress_hud_nsn sha256: "0b0d95e5ce3e1884390624fbe79fcf90d7de10abe05d26c0e276c25e7130e3e0" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.4.0" + oktoast: + dependency: "direct main" + description: + name: oktoast + sha256: f12a6f5c26986f8e48546104d4c0bea68dd82782940876ca299f7f406f521110 + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.3.2+1" path: dependency: transitive description: name: path sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.8.3" path_drawing: @@ -277,7 +285,7 @@ packages: description: name: path_drawing sha256: bbb1934c0cbb03091af082a6389ca2080345291ef07a5fa6d6e078ba8682f977 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.1" path_parsing: @@ -285,7 +293,7 @@ packages: description: name: path_parsing sha256: e3e67b1629e6f7e8100b367d3db6ba6af4b1f0bb80f64db18ef1fbabd2fa9ccf - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.1" path_provider: @@ -293,7 +301,7 @@ packages: description: name: path_provider sha256: a1aa8aaa2542a6bc57e381f132af822420216c80d4781f7aa085ca3229208aaa - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.1" path_provider_android: @@ -301,7 +309,7 @@ packages: description: name: path_provider_android sha256: e595b98692943b4881b219f0a9e3945118d3c16bd7e2813f98ec6e532d905f72 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.1" path_provider_foundation: @@ -309,7 +317,7 @@ packages: description: name: path_provider_foundation sha256: "19314d595120f82aca0ba62787d58dde2cc6b5df7d2f0daf72489e38d1b57f2d" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.3.1" path_provider_linux: @@ -317,7 +325,7 @@ packages: description: name: path_provider_linux sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.1" path_provider_platform_interface: @@ -325,7 +333,7 @@ packages: description: name: path_provider_platform_interface sha256: "94b1e0dd80970c1ce43d5d4e050a9918fce4f4a775e6142424c30a29a363265c" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.1" path_provider_windows: @@ -333,7 +341,7 @@ packages: description: name: path_provider_windows sha256: "8bc9f22eee8690981c22aa7fc602f5c85b497a6fb2ceb35ee5a5e5ed85ad8170" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.1" petitparser: @@ -341,7 +349,7 @@ packages: description: name: petitparser sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "5.4.0" platform: @@ -349,7 +357,7 @@ packages: description: name: platform sha256: "0a279f0707af40c890e80b1e9df8bb761694c074ba7e1d4ab1bc4b728e200b59" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.1.3" plugin_platform_interface: @@ -357,7 +365,7 @@ packages: description: name: plugin_platform_interface sha256: da3fdfeccc4d4ff2da8f8c556704c08f912542c5fb3cf2233ed75372384a034d - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.6" shared_preferences: @@ -365,7 +373,7 @@ packages: description: name: shared_preferences sha256: "81429e4481e1ccfb51ede496e916348668fd0921627779233bd24cc3ff6abd02" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.2" shared_preferences_android: @@ -373,7 +381,7 @@ packages: description: name: shared_preferences_android sha256: "8568a389334b6e83415b6aae55378e158fbc2314e074983362d20c562780fb06" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.1" shared_preferences_foundation: @@ -381,7 +389,7 @@ packages: description: name: shared_preferences_foundation sha256: "7bf53a9f2d007329ee6f3df7268fd498f8373602f943c975598bbb34649b62a7" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.3.4" shared_preferences_linux: @@ -389,7 +397,7 @@ packages: description: name: shared_preferences_linux sha256: "9f2cbcf46d4270ea8be39fa156d86379077c8a5228d9dfdb1164ae0bb93f1faa" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.3.2" shared_preferences_platform_interface: @@ -397,7 +405,7 @@ packages: description: name: shared_preferences_platform_interface sha256: d4ec5fc9ebb2f2e056c617112aa75dcf92fc2e4faaf2ae999caa297473f75d8a - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.3.1" shared_preferences_web: @@ -405,7 +413,7 @@ packages: description: name: shared_preferences_web sha256: d762709c2bbe80626ecc819143013cc820fa49ca5e363620ee20a8b15a3e3daf - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.1" shared_preferences_windows: @@ -413,7 +421,7 @@ packages: description: name: shared_preferences_windows sha256: "841ad54f3c8381c480d0c9b508b89a34036f512482c407e6df7a9c4aa2ef8f59" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.3.2" sign_button: @@ -421,7 +429,7 @@ packages: description: name: sign_button sha256: "03529ce0d98551f76e4cff9a9be35e28bec784a5406da80d087fa043d4625643" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.6" sky_engine: @@ -434,7 +442,7 @@ packages: description: name: source_span sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.10.0" stack_trace: @@ -442,7 +450,7 @@ packages: description: name: stack_trace sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.11.0" stream_channel: @@ -450,7 +458,7 @@ packages: description: name: stream_channel sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.1" string_scanner: @@ -458,7 +466,7 @@ packages: description: name: string_scanner sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.0" term_glyph: @@ -466,7 +474,7 @@ packages: description: name: term_glyph sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.1" test_api: @@ -474,7 +482,7 @@ packages: description: name: test_api sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.6.0" typed_data: @@ -482,15 +490,79 @@ packages: description: name: typed_data sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.2" + url_launcher: + dependency: "direct main" + description: + name: url_launcher + sha256: b1c9e98774adf8820c96fbc7ae3601231d324a7d5ebd8babe27b6dfac91357ba + url: "https://pub.flutter-io.cn" + source: hosted + version: "6.2.1" + url_launcher_android: + dependency: transitive + description: + name: url_launcher_android + sha256: "31222ffb0063171b526d3e569079cf1f8b294075ba323443fdc690842bfd4def" + url: "https://pub.flutter-io.cn" + source: hosted + version: "6.2.0" + url_launcher_ios: + dependency: transitive + description: + name: url_launcher_ios + sha256: "4ac97281cf60e2e8c5cc703b2b28528f9b50c8f7cebc71df6bdf0845f647268a" + url: "https://pub.flutter-io.cn" + source: hosted + version: "6.2.0" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + sha256: "9f2d390e096fdbe1e6e6256f97851e51afc2d9c423d3432f1d6a02a8a9a8b9fd" + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.1.0" + url_launcher_macos: + dependency: transitive + description: + name: url_launcher_macos + sha256: b7244901ea3cf489c5335bdacda07264a6e960b1c1b1a9f91e4bc371d9e68234 + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.1.0" + url_launcher_platform_interface: + dependency: transitive + description: + name: url_launcher_platform_interface + sha256: "980e8d9af422f477be6948bdfb68df8433be71f5743a188968b0c1b887807e50" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.2.0" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + sha256: "7fd2f55fe86cea2897b963e864dc01a7eb0719ecc65fcef4c1cc3d686d718bb2" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.2.0" + url_launcher_windows: + dependency: transitive + description: + name: url_launcher_windows + sha256: "7754a1ad30ee896b265f8d14078b0513a4dba28d358eabb9d5f339886f4a1adc" + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.1.0" vector_graphics: dependency: transitive description: name: vector_graphics sha256: "0f0c746dd2d6254a0057218ff980fc7f5670fd0fcf5e4db38a490d31eed4ad43" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.9+1" vector_graphics_codec: @@ -498,7 +570,7 @@ packages: description: name: vector_graphics_codec sha256: "0edf6d630d1bfd5589114138ed8fada3234deacc37966bec033d3047c29248b7" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.9+1" vector_graphics_compiler: @@ -506,7 +578,7 @@ packages: description: name: vector_graphics_compiler sha256: d24333727332d9bd20990f1483af4e09abdb9b1fc7c3db940b56ab5c42790c26 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.9+1" vector_math: @@ -514,7 +586,7 @@ packages: description: name: vector_math sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.4" web: @@ -522,7 +594,7 @@ packages: description: name: web sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.1.4-beta" webview_flutter: @@ -530,7 +602,7 @@ packages: description: name: webview_flutter sha256: "392c1d83b70fe2495de3ea2c84531268d5b8de2de3f01086a53334d8b6030a88" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.4" webview_flutter_android: @@ -538,7 +610,7 @@ packages: description: name: webview_flutter_android sha256: "8b3b2450e98876c70bfcead876d9390573b34b9418c19e28168b74f6cb252dbd" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.10.4" webview_flutter_platform_interface: @@ -546,7 +618,7 @@ packages: description: name: webview_flutter_platform_interface sha256: "812165e4e34ca677bdfbfa58c01e33b27fd03ab5fa75b70832d4b7d4ca1fa8cf" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.9.5" webview_flutter_plus: @@ -554,7 +626,7 @@ packages: description: name: webview_flutter_plus sha256: bea8756ae096529254725def7c4a633851a785c7d49206e0817125ab02b14307 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.3.0+2" webview_flutter_wkwebview: @@ -562,7 +634,7 @@ packages: description: name: webview_flutter_wkwebview sha256: a5364369c758892aa487cbf59ea41d9edd10f9d9baf06a94e80f1bd1b4c7bbc0 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.9.5" win32: @@ -570,7 +642,7 @@ packages: description: name: win32 sha256: "350a11abd2d1d97e0cc7a28a81b781c08002aa2864d9e3f192ca0ffa18b06ed3" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "5.0.9" xdg_directories: @@ -578,7 +650,7 @@ packages: description: name: xdg_directories sha256: "589ada45ba9e39405c198fe34eb0f607cddb2108527e658136120892beac46d2" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.3" xml: @@ -586,9 +658,9 @@ packages: description: name: xml sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "6.3.0" sdks: dart: ">=3.1.3 <4.0.0" - flutter: ">=3.7.0" + flutter: ">=3.13.0" diff --git a/pubspec.yaml b/pubspec.yaml index f154e14..8ce1cc8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -34,7 +34,7 @@ dependencies: flutter_spinkit: ^5.2.0 flutter_svg: ^2.0.8 flutter_holo_date_picker: ^1.1.3 - intl: ^0.18.1 + intl: ^0.18.1 loading_indicator: ^3.1.1 modal_progress_hud_nsn: ^0.4.0 shared_preferences: ^2.2.2 @@ -43,8 +43,10 @@ dependencies: google_fonts: ^6.1.0 dotted_border: ^2.1.0 datepicker_dropdown: ^0.0.8 - fluttertoast: ^8.2.2 + fluttertoast: ^8.0.7 dio: ^5.3.3 + url_launcher: ^6.0.9 + oktoast: ^3.0.0 dev_dependencies: flutter_lints: ^2.0.0 flutter_test: diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index f2acfe6..0004a69 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -7,8 +7,11 @@ #include "generated_plugin_registrant.h" #include +#include void RegisterPlugins(flutter::PluginRegistry* registry) { ModalProgressHudNsnPluginCApiRegisterWithRegistrar( registry->GetRegistrarForPlugin("ModalProgressHudNsnPluginCApi")); + UrlLauncherWindowsRegisterWithRegistrar( + registry->GetRegistrarForPlugin("UrlLauncherWindows")); } diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 3951f2f..d69ee09 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -4,6 +4,7 @@ list(APPEND FLUTTER_PLUGIN_LIST modal_progress_hud_nsn + url_launcher_windows ) list(APPEND FLUTTER_FFI_PLUGIN_LIST