问:
How do I keep the auth state and prevent re logging in each time i refresh the page or navigate to another page using firebase auth?
I can't seem to figure out how to maintain the login state.

I login, the app shows the condition if logged in, but then if I refresh the page, it asks me to login again.

I am using onAuthStateChanged, I just dont know what else to do.

This shows up when user not logged in

after I click login, this shows up

but when i click refresh, it shows you must login again.

here is my firebase config (the relevant bits)

function useAuth() {
  const [currentUser, setCurrentUser] = useState();
  useEffect(() => {
    const unsubsubscribe = onAuthStateChanged(auth, (user) =>
      setCurrentUser(user)
    );
    return unsubsubscribe;
  }, []);

  return currentUser;
}
export { app, storage, auth, database, useAuth };```
</div>
</div>
</p>
<p>I decide to create a function useAuth() inside firebase.config so i dont have to recreate it everywhere i need it.</p>
<p>Here is the login code</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>const Login = () => {
  const [email, setEmail] = useState("");
  const [password, setPassword] = useState("");
  const currentUser = useAuth();

  const [loading, setLoading] = useState(false);

  function login(email, password) {
    return auth
      .setPersistence(browserLocalPersistence)
      .then(() => {
        signInWithEmailAndPassword(auth, email, password).catch((error) => {
          const errorCode = error.code;
          const errorMessage = error.message;
          console.log(error);
        });
      })
      .catch((error) => {
        console.log(error);
      });
  }
  }</code>```

And here is the page I want to show if the user is logged in. It shows to correct component if logged in , but when i refresh the page it doesnt remember the logged in user.

here is the code for the page

const Properties = () => {
  const currentUser = useAuth();

  onAuthStateChanged(auth,(user))

  return (
    <>

        <title>Add Property</title>
        <meta name="keywords" content="web dev" />

Add Property

Welcome to the add Property new

      {console.log("user logged in? " + currentUser?.email)}

      {currentUser ? (
        <AddProperty />
      ) : (

You must be loggedin to add a property
{" "}
          <Login />

      )}
    </>
  );
};

export default Properties;```

Body:
I can't seem to figure out how to maintain the login state.

I login, the app shows the condition if logged in, but then if I refresh the page, it asks me to login again.

I am using onAuthStateChanged, I just dont know what else to do.

This shows up when user not logged in

after I click login, this shows up

but when i click refresh, it shows you must login again.

here is my firebase config (the relevant bits)

function useAuth() {
  const [currentUser, setCurrentUser] = useState();
  useEffect(() => {
    const unsubsubscribe = onAuthStateChanged(auth, (user) =>
      setCurrentUser(user)
    );
    return unsubsubscribe;
  }, []);

  return currentUser;
}
export { app, storage, auth, database, useAuth };

I decide to create a function useAuth() inside firebase.config so i dont have to recreate it everywhere i need it.

Here is the login code

const Login = () => {
  const [email, setEmail] = useState("");
  const [password, setPassword] = useState("");
  const currentUser = useAuth();

  const [loading, setLoading] = useState(false);

  function login(email, password) {
    return auth
      .setPersistence(browserLocalPersistence)
      .then(() => {
        signInWithEmailAndPassword(auth, email, password).catch((error) => {
          const errorCode = error.code;
          const errorMessage = error.message;
          console.log(error);
        });
      })
      .catch((error) => {
        console.log(error);
      });
  }
  }

And here is the page I want to show if the user is logged in. It shows to correct component if logged in , but when i refresh the page it doesnt remember the logged in user.

here is the code for the page

const Properties = () => {
  const currentUser = useAuth();

  onAuthStateChanged(auth,(user))

  return (
    <>

        <title>Add Property</title>
        <meta name="keywords" content="web dev" />

Add Property

Welcome to the add Property new

      {console.log("user logged in? " + currentUser?.email)}

      {currentUser ? (
        <AddProperty />
      ) : (

You must be loggedin to add a property
{" "}
          <Login />

      )}
    </>
  );
};

export default Properties;


来源: stackexchange

问:
Visual Studio 2022 installation issue
After installing Visual Studio 2022 Community Version on Windows 10, it does not work. I cannot add a project to a solution. Please see the error information:

The project file cannot be opened. Unable to locate the .net disk. Check if it is installed, your path is configured for the correct architecture, and that the version specified in global.json (if any) matches the installed version.

I would appreciate it if any one can help.

ContentLicense: CC BY-SA 4.0

Title: Visual Studio 2022 installation issue


问:
UWA Print Dialog Box in Win32 - with UWA dialog crashes, with Win32 dialog never
I have a 30 year old print dialog routine

It is only upgraded for UTF16 characters (WCHAR), that always worked based on the sequences:

```<code>if ((S_OK == PrintDlgEx(&pdPrint)) && pdPrint.dwResultAction == PD_RESULT_PRINT && pdPrint.hDC) {
if (StartDoc(pdPrint.hDC, &diPrint) == SP_ERROR) {
</code>```

Suddenly I installed an Office 2021 in one of my computers and the Win32 Print dialog changed to a UWA Print dialog (layout), and the title:

Is not just the usual "Print"

But "Printing from a Win32 program - Print".

It is obvious that MS office installs another print dialog and it has other parameters that the regular PrintDlgEx does not support, kind of conversion.

The Problem - StartDoc() crashes

It is crashing by StartDoc() with

```<code>"Exception thrown at 0x00007FFAE6406BC in XXXXXX.exe: Microsoft C++ exception: winrt::hresult_error at memory location 0x000000371555C4D0."
</code>```

And there is absolutely no debugging by StartDoc(), it's under the hood. But remarkably also is that there are nothing the program allocates memory for, it all comes from the print dialog.

Same code in my laptop with Office 2008 installed, still Win32 Print dialog and no problem.

As far as I know no changes made (except Win 11 22H2 upgrades and VS Upgrade to 17.4.3 but still v143) to the version distributed in MS Store (by me), it does not crash in any of my computers.

What to do about it?

The basic problem is that I, as a SW supplier via the MS Store, have no control over which programs my customers install in their computer next to my program. (I'm not supposed to care, but apparently I do.)

I can't tell my customers they have to restore the print kernel after they installed MS Office? (suggestion in Google search)

There are two sides to it:

Sudden crashes in "commercial" SW is not acceptable

It doesn't look good with the title "Print" is exchanged  to the UWA Print Dialog (if Office is installed) "Printing from a Win32 program - Print", I like to find a way to put something in line with my program, to show my users.

Is there a new Win32 SDK feature that supports putting the title, preview and is crash free available? Something I can call instead of PrintDlgEx()?

Or are there other ways to handle the situation?

Body:
I have a 30 year old print dialog routine

It is only upgraded for UTF16 characters (WCHAR), that always worked based on the sequences:

if ((S_OK == PrintDlgEx(&pdPrint)) && pdPrint.dwResultAction == PD_RESULT_PRINT && pdPrint.hDC) {
if (StartDoc(pdPrint.hDC, &diPrint) == SP_ERROR) {

Suddenly I installed an Office 2021 in one of my computers and the Win32 Print dialog changed to a UWA Print dialog (layout), and the title:

Is not just the usual "Print"

But "Printing from a Win32 program - Print".

It is obvious that MS office installs another print dialog and it has other parameters that the regular PrintDlgEx does not support, kind of conversion.

The Problem - StartDoc() crashes

It is crashing by StartDoc() with

"Exception thrown at 0x00007FFAE6406BC in XXXXXX.exe: Microsoft C++ exception: winrt::hresult_error at memory location 0x000000371555C4D0."

And there is absolutely no debugging by StartDoc(), it's under the hood. But remarkably also is that there are nothing the program allocates memory for, it all comes from the print dialog.

Same code in my laptop with Office 2008 installed, still Win32 Print dialog and no problem.

As far as I know no changes made (except Win 11 22H2 upgrades and VS Upgrade to 17.4.3 but still v143) to the version distributed in MS Store (by me), it does not crash in any of my computers.

What to do about it?

The basic problem is that I, as a SW supplier via the MS Store, have no control over which programs my customers install in their computer next to my program. (I'm not supposed to care, but apparently I do.)

I can't tell my customers they have to restore the print kernel after they installed MS Office? (suggestion in Google search)

There are two sides to it:

Sudden crashes in "commercial" SW is not acceptable

It doesn't look good with the title "Print" is exchanged  to the UWA Print Dialog (if Office is installed) "Printing from a Win32 program - Print", I like to find a way to put something in line with my program, to show my users.

Is there a new Win32 SDK feature that supports putting the title, preview and is crash free available? Something I can call instead of PrintDlgEx()?

Or are there other ways to handle the situation?


问:
Is it possible to use pywebview on windows 7?
I am trying to run project using pywebview on virtual win7 x32 with the goal of freezing it with pyinstaller and am getting all sorts of exceptions. Latest version seems to consider my system being arm64, version before that searches for shcore, which is supported starting win8, and versions before that throw System.NullReferenceException.

So my question is - is it possible at all?
I mean, newer versions seem to not support it - https://github.com/r0x0r/pywebview/issues/891. On the other hand, both win7 and winXP are mentioned right there on the front github page - so at least something should work, right?


问:
consumer widget showing black screen
I'm trying to use a Consumer widget in my Flutter app to show a loading indicator or an error message based on the status of my AuthProvider, but when I navigate to the RegistrationScreen it just shows a black screen.

Here is the code for my RegistrationScreen:

```<code>class RegistrationScreen extends StatelessWidget {
  const RegistrationScreen({super.key});

  @override
  Widget build(BuildContext context) {
    NavigationService service = NavigationService();
    final authProviders = Provider.of<AuthProvider>(context, listen: true);
    // final authService = AuthService();
    final firstNameController = TextEditingController();
    final lastNameController = TextEditingController();
    final phoneNumberController = TextEditingController();
    final emailController = TextEditingController();
    final passwordController = TextEditingController();

    return Consumer<AuthProvider>(builder: (context, authProvider, child) {
      if (authProvider.status == AuthStatus.loading) {
        return Center(
          child: Platform.isIOS
              ? const CupertinoActivityIndicator()
              : const CircularProgressIndicator(),
        );
      } else if (authProvider.status == AuthStatus.success) {
        service.navigateTo("/otp_screen", arguments: "jdn");
      } else if (authProvider.status == AuthStatus.error) {
        if (Platform.isIOS) {
          return FutureBuilder(
            future: showCupertinoDialog(
              context: context,
              builder: (BuildContext context) => CupertinoAlertDialog(
                title: const Text("Error"),
                content: Text(authProvider.errorMessage!),
                actions: [
                  CupertinoDialogAction(
                    onPressed: () {
                      Navigator.of(context).pop();
                    },
                    isDefaultAction: true,
                    child: const Text("ok"),
                  ),
                ],
              ),
            ),
            builder: (context, snapshot) {
              if (snapshot.connectionState == ConnectionState.done) {
                return Text(
                    ""); // or any other widget you want to show when the dialog is closed
              }
              return MainForm(
                  firstNameController: firstNameController,
                  lastNameController: lastNameController,
                  phoneNumberController: phoneNumberController,
                  emailController: emailController,
                  passwordController: passwordController,
                  authProvider:
                      authProvider); // or any other widget you want to show while the dialog is open
            },
          );
        }
      }

      // Return the rest of your UI here
      return MainForm(
          firstNameController: firstNameController,
          lastNameController: lastNameController,
          phoneNumberController: phoneNumberController,
          emailController: emailController,
          passwordController: passwordController,
          authProvider: authProvider);
    });
  }
}
</code>```

Here is a stateless widget for showing textfields

```<code>class MainForm extends StatelessWidget {
  const MainForm({
    Key? key,
    required this.firstNameController,
    required this.lastNameController,
    required this.phoneNumberController,
    required this.emailController,
    required this.passwordController,
    required this.authProvider,
  }) : super(key: key);

  final TextEditingController firstNameController;
  final TextEditingController lastNameController;
  final TextEditingController phoneNumberController;
  final TextEditingController emailController;
  final TextEditingController passwordController;
  final AuthProvider authProvider;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: Column(
      mainAxisAlignment: MainAxisAlignment.center,
      children: [
        const Text(
          "Trend Spotter ",
          style: TextStyle(fontSize: 35),
        ),
        const SizedBox(
          height: 10,
        ),
        const Text(
          "Register ",
          style: TextStyle(fontSize: 35),
        ),
        const SizedBox(
          height: 10,
        ),
        CustomTextField(
          textToDisplay: "First Name",
          fontSize: Constants.loginButtonFontSize,
          textFieldPadding: Constants.loginTextFieldOutLinePadding,
          obscureText: false,
          controller: firstNameController,
          type: TextInputType.name,
        ),
        const SizedBox(
          height: 10,
        ),
        CustomTextField(
          textToDisplay: "Last Name",
          fontSize: Constants.loginButtonFontSize,
          textFieldPadding: Constants.loginTextFieldOutLinePadding,
          obscureText: false,
          controller: lastNameController,
          type: TextInputType.name,
        ),
        const SizedBox(
          height: 10,
        ),
        CustomTextField(
            textToDisplay: "Phone Number",
            fontSize: Constants.loginButtonFontSize,
            textFieldPadding: Constants.loginTextFieldOutLinePadding,
            obscureText: false,
            controller: phoneNumberController,
            type: TextInputType.phone),
        const SizedBox(
          height: 10,
        ),
        CustomTextField(
          textToDisplay: "Email",
          fontSize: Constants.loginButtonFontSize,
          textFieldPadding: Constants.loginTextFieldOutLinePadding,
          obscureText: false,
          controller: emailController,
          type: TextInputType.emailAddress,
        ),
        const SizedBox(
          height: 10,
        ),
        CustomTextField(
          textToDisplay: Constants.loginTextfieldPassword,
          fontSize: Constants.loginButtonFontSize,
          textFieldPadding: Constants.loginTextFieldOutLinePadding,
          obscureText: true,
          controller: passwordController,
          type: TextInputType.visiblePassword,
        ),
        const SizedBox(
          height: 10,
        ),
        ElevatedButton(
          style: ElevatedButton.styleFrom(
            fixedSize: const Size(
                Constants.loginButtonWidth, Constants.loginButtonHeight),
          ),
          onPressed: () async {
            await authProvider.registration(
                email: emailController.text,
                firstName: firstNameController.text,
                lastName: lastNameController.text,
                phoneNumber: phoneNumberController.text,
                password: passwordController.text);
          },
          child: const Text("Sign up"),
        )
      ],
    ));
  }
}
</code>```

Title: consumer widget showing black screen

Body:
I'm trying to use a Consumer widget in my Flutter app to show a loading indicator or an error message based on the status of my AuthProvider, but when I navigate to the RegistrationScreen it just shows a black screen.

Here is the code for my RegistrationScreen:

class RegistrationScreen extends StatelessWidget {
  const RegistrationScreen({super.key});

  @override
  Widget build(BuildContext context) {
    NavigationService service = NavigationService();
    final authProviders = Provider.of<AuthProvider>(context, listen: true);
    // final authService = AuthService();
    final firstNameController = TextEditingController();
    final lastNameController = TextEditingController();
    final phoneNumberController = TextEditingController();
    final emailController = TextEditingController();
    final passwordController = TextEditingController();

    return Consumer<AuthProvider>(builder: (context, authProvider, child) {
      if (authProvider.status == AuthStatus.loading) {
        return Center(
          child: Platform.isIOS
              ? const CupertinoActivityIndicator()
              : const CircularProgressIndicator(),
        );
      } else if (authProvider.status == AuthStatus.success) {
        service.navigateTo("/otp_screen", arguments: "jdn");
      } else if (authProvider.status == AuthStatus.error) {
        if (Platform.isIOS) {
          return FutureBuilder(
            future: showCupertinoDialog(
              context: context,
              builder: (BuildContext context) => CupertinoAlertDialog(
                title: const Text("Error"),
                content: Text(authProvider.errorMessage!),
                actions: [
                  CupertinoDialogAction(
                    onPressed: () {
                      Navigator.of(context).pop();
                    },
                    isDefaultAction: true,
                    child: const Text("ok"),
                  ),
                ],
              ),
            ),
            builder: (context, snapshot) {
              if (snapshot.connectionState == ConnectionState.done) {
                return Text(
                    ""); // or any other widget you want to show when the dialog is closed
              }
              return MainForm(
                  firstNameController: firstNameController,
                  lastNameController: lastNameController,
                  phoneNumberController: phoneNumberController,
                  emailController: emailController,
                  passwordController: passwordController,
                  authProvider:
                      authProvider); // or any other widget you want to show while the dialog is open
            },
          );
        }
      }

      // Return the rest of your UI here
      return MainForm(
          firstNameController: firstNameController,
          lastNameController: lastNameController,
          phoneNumberController: phoneNumberController,
          emailController: emailController,
          passwordController: passwordController,
          authProvider: authProvider);
    });
  }
}

Here is a stateless widget for showing textfields

class MainForm extends StatelessWidget {
  const MainForm({
    Key? key,
    required this.firstNameController,
    required this.lastNameController,
    required this.phoneNumberController,
    required this.emailController,
    required this.passwordController,
    required this.authProvider,
  }) : super(key: key);

  final TextEditingController firstNameController;
  final TextEditingController lastNameController;
  final TextEditingController phoneNumberController;
  final TextEditingController emailController;
  final TextEditingController passwordController;
  final AuthProvider authProvider;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: Column(
      mainAxisAlignment: MainAxisAlignment.center,
      children: [
        const Text(
          "Trend Spotter ",
          style: TextStyle(fontSize: 35),
        ),
        const SizedBox(
          height: 10,
        ),
        const Text(
          "Register ",
          style: TextStyle(fontSize: 35),
        ),
        const SizedBox(
          height: 10,
        ),
        CustomTextField(
          textToDisplay: "First Name",
          fontSize: Constants.loginButtonFontSize,
          textFieldPadding: Constants.loginTextFieldOutLinePadding,
          obscureText: false,
          controller: firstNameController,
          type: TextInputType.name,
        ),
        const SizedBox(
          height: 10,
        ),
        CustomTextField(
          textToDisplay: "Last Name",
          fontSize: Constants.loginButtonFontSize,
          textFieldPadding: Constants.loginTextFieldOutLinePadding,
          obscureText: false,
          controller: lastNameController,
          type: TextInputType.name,
        ),
        const SizedBox(
          height: 10,
        ),
        CustomTextField(
            textToDisplay: "Phone Number",
            fontSize: Constants.loginButtonFontSize,
            textFieldPadding: Constants.loginTextFieldOutLinePadding,
            obscureText: false,
            controller: phoneNumberController,
            type: TextInputType.phone),
        const SizedBox(
          height: 10,
        ),
        CustomTextField(
          textToDisplay: "Email",
          fontSize: Constants.loginButtonFontSize,
          textFieldPadding: Constants.loginTextFieldOutLinePadding,
          obscureText: false,
          controller: emailController,
          type: TextInputType.emailAddress,
        ),
        const SizedBox(
          height: 10,
        ),
        CustomTextField(
          textToDisplay: Constants.loginTextfieldPassword,
          fontSize: Constants.loginButtonFontSize,
          textFieldPadding: Constants.loginTextFieldOutLinePadding,
          obscureText: true,
          controller: passwordController,
          type: TextInputType.visiblePassword,
        ),
        const SizedBox(
          height: 10,
        ),
        ElevatedButton(
          style: ElevatedButton.styleFrom(
            fixedSize: const Size(
                Constants.loginButtonWidth, Constants.loginButtonHeight),
          ),
          onPressed: () async {
            await authProvider.registration(
                email: emailController.text,
                firstName: firstNameController.text,
                lastName: lastNameController.text,
                phoneNumber: phoneNumberController.text,
                password: passwordController.text);
          },
          child: const Text("Sign up"),
        )
      ],
    ));
  }
}


问:
Call function in class State for checked Checkbox from subclass in one file .dart
How to call function with setState  for checked Checkbox from sub class in one file dart,
i has tried like this but still eror,
this is error '
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: setState() called in constructor: _CustomerWgtFormState#a6d60(lifecycle state: created, no widget, not mounted)
E/flutter ( 3739): This happens when you call setState() on a State object for a widget that hasn't been inserted into the widget tree yet.
It is not necessary to call setState() in the constructor, since the state is already assumed to be dirty when it is initially created.
'

eror ini line code
//ERROOR
//error in this line, while want to set Checkbox with true
m.createState().changedWeek1(true);

these is my code

file class CustomerScreen.dart

```<code>import 'package:bubble_tab_indicator/bubble_tab_indicator.dart';
import 'package:flutter/material.dart';
import 'package:sfaf/view/widgatepage/wgtpage_customer/CustomerWgtForm.dart';
import 'package:sfaf/view/widgatepage/wgtpage_customer/CustomerWgtLV.dart';

void main() {
  runApp(CustomerScreen());
}
class CustomerScreen extends StatefulWidget {
  @override
  _CustomerScreenState createState() => _CustomerScreenState();
}

late TabController _tabController;

class _CustomerScreenState extends State<CustomerScreen> with TickerProviderStateMixin{

  late FocusNode myFocusNode;
  CustomerWgtForm _customerWgtForm=new CustomerWgtForm();
  CustomerWgtLV   _customerWgtLV =new CustomerWgtLV();

  @override
  void initState() {
    super.initState();
      _tabController = TabController(length: 2, vsync: this, initialIndex: 0,);
      _tabController.addListener(_handleTabSelection);
      myFocusNode = FocusNode();
      WidgetsBinding.instance.addPostFrameCallback((_) {
         FocusScope.of(context).requestFocus(myFocusNode);
      });
  }

  @override
  void dispose() {
    myFocusNode.dispose();
   _tabController.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        debugShowCheckedModeBanner: false,
        home: Scaffold(
            appBar: AppBar(
              title: Text("Customer"),
              elevation: 0.0,
              titleSpacing: 10.0,
              centerTitle: true,
              leading: InkWell(
                onTap: () {
                  Navigator.pop(context);
                },
                child: Icon(Icons.arrow_back_ios, color: Colors.black54,),
              ),
            ),
`
            body:Column(
               children:[
                   Container(
                     color: Colors.indigo, height: 50, width: 800,
                     margin: EdgeInsets.fromLTRB(0, 0, 0, 5),
                     child: TabBar(
                            controller: _tabController,
                         indicatorSize: TabBarIndicatorSize.tab,
                          isScrollable: true,
                  unselectedLabelColor: Colors.black,
                             indicator: BubbleTabIndicator(
                                    indicatorHeight: 48,
                                     indicatorColor: Colors.amber,
                tabBarIndicatorSize: TabBarIndicatorSize.tab,
                                    indicatorRadius: 5,
                             ),
                      tabs: [
                              Tab(icon :Image.asset("images/add_sign.png",),text:'Create Data'),
                              Tab(icon :Image.asset("images/list_go.png",),text:'List Data',)
                            ]
                            ),
                    ),
                    Expanded(
                      child: Container(
                               height: 900,
                               margin: EdgeInsets.fromLTRB(0, 0, 0, 5),
                                child: TabBarView(
                           controller: _tabController,
                             children: [
                                    _customerWgtForm,
                                    _customerWgtLV
                                 ]
                                )
                            )
                    )
                  ]
            )

        )
    );
  }
}
 //subclass
 class SelectedIndexTabbar{
    static setSelectedIndexTabbarCreateData(){
       _tabController.index=0;
    }
 }
`

file class CustomerWgtLV.dart
import 'package:flutter/material.dart';
import 'package:sfaf/database/entity/Customer.dart';
import 'package:sfaf/database/impl/CustomerImpl.dart';
import 'package:sfaf/view/widgatepage/wgtpage_customer/CustomerWgtForm.dart';

TextEditingController searchNameController = TextEditingController();

  List<Customer?>_getListCustomer=<Customer>[];
  Future _getListCustomerFromDB() async {
       Future<List<Customer?>>? listCustomer=null;
       if(searchNameController.text.isEmpty) {
            listCustomer = CustomerImpl().getListCustomerImpl();
       }
       else{
            listCustomer =   CustomerImpl().getListCustomerByCustNameImpl(searchNameController.text.toString());
       }
       List<Customer?> listnya = await listCustomer ;
       _getListCustomer=listnya;
  }

  class CustomerWgtLV extends StatefulWidget {
       @override
       _CustomerWgtLVState createState() => new _CustomerWgtLVState();
  }

class _CustomerWgtLVState extends State<CustomerWgtLV> {
  final GlobalKey<RefreshIndicatorState> _refreshIndicatorKey =  GlobalKey<RefreshIndicatorState>();
  Future<void> refreshListCustomers() async {
    setState(() {
        _getListCustomerFromDB();
    });
  }

  @override
  void initState() {
    refreshListCustomers();
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return RefreshIndicator(
             key: _refreshIndicatorKey,
       onRefresh: () async  {
              _refreshIndicatorKey.currentState?.show();
               refreshListCustomers();
        },
        child: Scaffold(
            backgroundColor:  Colors.blueAccent,
            appBar: AppBar(
            title: Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                const Text("List Customers"),
                Expanded(
                  child: TextField(),
                ),
              ],
            ),
          ),
        body: _buildCardDesign(),
      ),
    );

  }

  Widget _buildCardDesign() {
    return Container(
      margin: EdgeInsets.all(0),
      child: ListView.builder(
          itemCount: _getListCustomer.length,
          shrinkWrap: true,
          physics: const BouncingScrollPhysics(
          parent: AlwaysScrollableScrollPhysics()),
          scrollDirection: Axis.vertical,
          itemBuilder: (BuildContext context, int index) {
               var customer = _getListCustomer[index];
               return _buildCardView(customer);
          },
        ),
    );
  }

  Widget _buildCardView(Customer? customer) {
    return Container(
      width: MediaQuery.of(context).size.width,
      child: Container(
        margin: EdgeInsets.all(7),
        height: 120,
        width: MediaQuery.of(context).size.width,
        decoration: BoxDecoration(color: Colors.white,borderRadius: BorderRadius.all(Radius.circular(10))),
        padding: EdgeInsets.fromLTRB(10, 5, 2, 5),
        child: Stack(
          children: [
            Row(
              children: [
                ClipRRect(
                 borderRadius: BorderRadius.circular(10.0),
                        child: Image.asset('images/shop_on_ballon_36.png', height: 90.0 , width: 60.0, fit: BoxFit.cover,),
                ),
                Container(
                  padding: EdgeInsets.only(left: 10),
                    child: Column(crossAxisAlignment: CrossAxisAlignment.start,
                            children: [
                               Container(
                                  child: Text('${customer!.custCode} -  ${customer.custName}',
                                              style: TextStyle(color: Colors.black,fontWeight: FontWeight.bold,fontSize: 14), ),
                               ),
                            ]
                    ),
                ),
             ],
          ),
          Positioned(top: 80, left: 285,
           child:SizedBox(
                  width: 80,height: 25,
                  child:ElevatedButton(
               style: ElevatedButton.styleFrom(
                  minimumSize: const Size.fromHeight(5),
                                    shape: RoundedRectangleBorder(
                             borderRadius: BorderRadius.circular(25),),
                elevation: 15.0,
                           ),
                           onPressed:() async {
                 //Call function getForUpdate in file CustomerWgtForm.dart
                 //and this UpdateDataCust is Sub class from file CustomerWgtForm,
                             //getForUpdate this is static function
                 //when this execute/button Edit is clicked/tap error
                 UpdateDataCust.getForUpdate(customer!.custId);
                           },
                           child: Row(mainAxisSize: MainAxisSize.min,
                               children: const <Widget>[
                                           Text('Edit', style: TextStyle(fontSize: 14)),
                                ]
                                 ),
                )
               )
          ),

          ]
        ),
      ),

    );
  }

}

file class CustomerWgtForm.dart
import 'package:flutter/material.dart';
import 'package:sfaf/database/entity/Customer.dart';
import 'package:sfaf/database/impl/CustomerImpl.dart';
import 'package:sfaf/view/screen/master/CustomerScreen.dart';
import 'dart:async';

TextEditingController custCodeController = TextEditingController();
TextEditingController custNameController = TextEditingController();
FocusNode custNameFocusNode = new FocusNode();

bool valueW1 = false;
bool valueW2 = false;
ValueNotifier<bool>  valueNotifierWeek1 = ValueNotifier<bool>(false);
StreamController<bool> streamController = StreamController<bool>();

class CustomerWgtForm extends StatefulWidget {
  @override
  _CustomerWgtFormState createState() => new _CustomerWgtFormState();

 }

class _CustomerWgtFormState extends State<CustomerWgtForm> {
  late FocusNode myFocusNode;

  //Call this function in subclass, Erorr
  changedWeek1(bool val) async {
       setState(() {
         valueW1=val;
      });
  }
  changedWeek2(bool val){ setState(() { valueW2=val; }); }

  @override
  void initState() {
      super.initState();
      myFocusNode = FocusNode();
  }
  @override
  void dispose() {
    myFocusNode.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
       return ListView(
       itemExtent: 700.0,
       shrinkWrap: true,
       scrollDirection: Axis.vertical,
       children: [
         Container(
           child: Stack(
            alignment: AlignmentDirectional.center,
                     children: <Widget>[
                                 Positioned( top: 10, left: 5, child:
                                           Text('Cust Code', textAlign: TextAlign.right,) ),
                                 Positioned( top: 3, left: 90,
                                   child:SizedBox(
                                     width: 100,height: 35,
                                             child: TextField(
                                                      controller: custCodeController,
                                                      decoration: InputDecoration(
                                                   enabledBorder: OutlineInputBorder(
                                                          borderSide: BorderSide(
                                                                    width: 1,
                                                                    color: Colors.blueGrey),),
                                                    focusedBorder: OutlineInputBorder(
                                                          borderSide: BorderSide(
                                                                    width: 1,
                                                                    color: Colors.amber),),
                                                       ),
                                             ),
                                    )
                                 ),
                                 Positioned(
                                     top:47,
                                    left: 5,
                                   child: Text('Cust Name') ),
                                 Positioned(
                                     top:44,
                                    left: 90,
                                   child:SizedBox(
                       width: 250,height: 35,
                                           child: TextField(
                                controller: custNameController,
                                                    decoration: InputDecoration(
                                  enabledBorder: OutlineInputBorder(
                                  borderSide: BorderSide(
                                                                      width: 1,
                                                                      color: Colors.blueGrey),),
                                                          focusedBorder: OutlineInputBorder(
                                                                      borderSide: BorderSide(
                                                                      width: 1,
                                                                      color: Colors.amber),),
                                                     ),
                                                     focusNode: custNameFocusNode,
                                          ),
                                  )
                                 ),

                    //WEEK VISITED use Checkbox widget
                    Positioned(
            top:406, left: 0,
                      child:SizedBox(
                      width: 270,height: 250,
                          child: Padding(
            padding: const EdgeInsets.all(9.0),
                              child: InputDecorator(
                         decoration: InputDecoration(
                          labelText: 'Week Visited',
                     labelStyle: TextStyle(
                                                  color: Colors.blue),
                                                 border: OutlineInputBorder(
                                                         borderRadius: BorderRadius.circular(5.0),
                                                ),

                                         contentPadding: EdgeInsets.all(10),
                                     ),
                                     child: Row(
                    mainAxisAlignment: MainAxisAlignment.start,
                                          children: [
                                              SizedBox(
                           height: 24.0, width: 24.0,
                                                child: Checkbox(
                                                          value: valueW1!,
                                                      onChanged: (bool? val) {
                                                         changedWeek1(val!);
                                                      },
                                                 )
                                               ),
                                               SizedBox(width: 2.0),
                                               Text("W1"),
                                               SizedBox(width: 10.0),
                                               SizedBox(
                        height: 24.0, width: 24.0,
                                                 child: Checkbox(
                                     value: valueW2,
                                                     onChanged: (bool? val) {
                                                        changedWeek2(val!);
                                                     },
                                                 )
                                               ),
                                               SizedBox(width: 2.0),
                           Text("W2"),
                           SizedBox(width: 10.0),
                                           ]
                                         ),
                                       ),
                                  ),
                         )
                  ),
              ]

  )
  ),
  ],
  );
  }

  }

  //function for reset widget TextField
 clear(){
     custCodeController.text="";
     custNameController.text="";
  }`

  //SUB CLASS
  //Sub class with static function will call in class CustomerWgtLV.dart
  class UpdateDataCust with ChangeNotifier  {
     static getForUpdate(String? custId) async  {
       try {
             SelectedIndexTabbar.setSelectedIndexTabbarCreateData();

             clear();
             Customer? customer = await CustomerImpl().getCustomerById(custId!.toString());
             custCodeController.text = customer!.custCode.toString();
             custNameController.text = customer!.custName.toString();

             CustomerWgtForm m= new CustomerWgtForm();

         //ERROOOOOOR
         //error in this line, while want to set Checkbox with true
             m.createState().changedWeek1(true);

       }
       catch (e) {
          print(e.toString());
       }
     }

 }

thanks
</code>```

Body:
How to call function with setState  for checked Checkbox from sub class in one file dart,
i has tried like this but still eror,
this is error '
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: setState() called in constructor: _CustomerWgtFormState#a6d60(lifecycle state: created, no widget, not mounted)
E/flutter ( 3739): This happens when you call setState() on a State object for a widget that hasn't been inserted into the widget tree yet.
It is not necessary to call setState() in the constructor, since the state is already assumed to be dirty when it is initially created.
'

eror ini line code
//ERROOR
//error in this line, while want to set Checkbox with true
m.createState().changedWeek1(true);

these is my code

file class CustomerScreen.dart

import 'package:bubble_tab_indicator/bubble_tab_indicator.dart';
import 'package:flutter/material.dart';
import 'package:sfaf/view/widgatepage/wgtpage_customer/CustomerWgtForm.dart';
import 'package:sfaf/view/widgatepage/wgtpage_customer/CustomerWgtLV.dart';

void main() {
  runApp(CustomerScreen());
}
class CustomerScreen extends StatefulWidget {
  @override
  _CustomerScreenState createState() => _CustomerScreenState();
}

late TabController _tabController;

class _CustomerScreenState extends State<CustomerScreen> with TickerProviderStateMixin{

  late FocusNode myFocusNode;
  CustomerWgtForm _customerWgtForm=new CustomerWgtForm();
  CustomerWgtLV   _customerWgtLV =new CustomerWgtLV();

  @override
  void initState() {
    super.initState();
      _tabController = TabController(length: 2, vsync: this, initialIndex: 0,);
      _tabController.addListener(_handleTabSelection);
      myFocusNode = FocusNode();
      WidgetsBinding.instance.addPostFrameCallback((_) {
         FocusScope.of(context).requestFocus(myFocusNode);
      });
  }

  @override
  void dispose() {
    myFocusNode.dispose();
   _tabController.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        debugShowCheckedModeBanner: false,
        home: Scaffold(
            appBar: AppBar(
              title: Text("Customer"),
              elevation: 0.0,
              titleSpacing: 10.0,
              centerTitle: true,
              leading: InkWell(
                onTap: () {
                  Navigator.pop(context);
                },
                child: Icon(Icons.arrow_back_ios, color: Colors.black54,),
              ),
            ),
`
            body:Column(
               children:[
                   Container(
                     color: Colors.indigo, height: 50, width: 800,
                     margin: EdgeInsets.fromLTRB(0, 0, 0, 5),
                     child: TabBar(
                            controller: _tabController,
                         indicatorSize: TabBarIndicatorSize.tab,
                          isScrollable: true,
                  unselectedLabelColor: Colors.black,
                             indicator: BubbleTabIndicator(
                                    indicatorHeight: 48,
                                     indicatorColor: Colors.amber,
                tabBarIndicatorSize: TabBarIndicatorSize.tab,
                                    indicatorRadius: 5,
                             ),
                      tabs: [
                              Tab(icon :Image.asset("images/add_sign.png",),text:'Create Data'),
                              Tab(icon :Image.asset("images/list_go.png",),text:'List Data',)
                            ]
                            ),
                    ),
                    Expanded(
                      child: Container(
                               height: 900,
                               margin: EdgeInsets.fromLTRB(0, 0, 0, 5),
                                child: TabBarView(
                           controller: _tabController,
                             children: [
                                    _customerWgtForm,
                                    _customerWgtLV
                                 ]
                                )
                            )
                    )
                  ]
            )

        )
    );
  }
}
 //subclass
 class SelectedIndexTabbar{
    static setSelectedIndexTabbarCreateData(){
       _tabController.index=0;
    }
 }
`

file class CustomerWgtLV.dart
import 'package:flutter/material.dart';
import 'package:sfaf/database/entity/Customer.dart';
import 'package:sfaf/database/impl/CustomerImpl.dart';
import 'package:sfaf/view/widgatepage/wgtpage_customer/CustomerWgtForm.dart';

TextEditingController searchNameController = TextEditingController();

  List<Customer?>_getListCustomer=<Customer>[];
  Future _getListCustomerFromDB() async {
       Future<List<Customer?>>? listCustomer=null;
       if(searchNameController.text.isEmpty) {
            listCustomer = CustomerImpl().getListCustomerImpl();
       }
       else{
            listCustomer =   CustomerImpl().getListCustomerByCustNameImpl(searchNameController.text.toString());
       }
       List<Customer?> listnya = await listCustomer ;
       _getListCustomer=listnya;
  }

  class CustomerWgtLV extends StatefulWidget {
       @override
       _CustomerWgtLVState createState() => new _CustomerWgtLVState();
  }

class _CustomerWgtLVState extends State<CustomerWgtLV> {
  final GlobalKey<RefreshIndicatorState> _refreshIndicatorKey =  GlobalKey<RefreshIndicatorState>();
  Future<void> refreshListCustomers() async {
    setState(() {
        _getListCustomerFromDB();
    });
  }

  @override
  void initState() {
    refreshListCustomers();
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return RefreshIndicator(
             key: _refreshIndicatorKey,
       onRefresh: () async  {
              _refreshIndicatorKey.currentState?.show();
               refreshListCustomers();
        },
        child: Scaffold(
            backgroundColor:  Colors.blueAccent,
            appBar: AppBar(
            title: Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                const Text("List Customers"),
                Expanded(
                  child: TextField(),
                ),
              ],
            ),
          ),
        body: _buildCardDesign(),
      ),
    );

  }

  Widget _buildCardDesign() {
    return Container(
      margin: EdgeInsets.all(0),
      child: ListView.builder(
          itemCount: _getListCustomer.length,
          shrinkWrap: true,
          physics: const BouncingScrollPhysics(
          parent: AlwaysScrollableScrollPhysics()),
          scrollDirection: Axis.vertical,
          itemBuilder: (BuildContext context, int index) {
               var customer = _getListCustomer[index];
               return _buildCardView(customer);
          },
        ),
    );
  }

  Widget _buildCardView(Customer? customer) {
    return Container(
      width: MediaQuery.of(context).size.width,
      child: Container(
        margin: EdgeInsets.all(7),
        height: 120,
        width: MediaQuery.of(context).size.width,
        decoration: BoxDecoration(color: Colors.white,borderRadius: BorderRadius.all(Radius.circular(10))),
        padding: EdgeInsets.fromLTRB(10, 5, 2, 5),
        child: Stack(
          children: [
            Row(
              children: [
                ClipRRect(
                 borderRadius: BorderRadius.circular(10.0),
                        child: Image.asset('images/shop_on_ballon_36.png', height: 90.0 , width: 60.0, fit: BoxFit.cover,),
                ),
                Container(
                  padding: EdgeInsets.only(left: 10),
                    child: Column(crossAxisAlignment: CrossAxisAlignment.start,
                            children: [
                               Container(
                                  child: Text('${customer!.custCode} -  ${customer.custName}',
                                              style: TextStyle(color: Colors.black,fontWeight: FontWeight.bold,fontSize: 14), ),
                               ),
                            ]
                    ),
                ),
             ],
          ),
          Positioned(top: 80, left: 285,
           child:SizedBox(
                  width: 80,height: 25,
                  child:ElevatedButton(
               style: ElevatedButton.styleFrom(
                  minimumSize: const Size.fromHeight(5),
                                    shape: RoundedRectangleBorder(
                             borderRadius: BorderRadius.circular(25),),
                elevation: 15.0,
                           ),
                           onPressed:() async {
                 //Call function getForUpdate in file CustomerWgtForm.dart
                 //and this UpdateDataCust is Sub class from file CustomerWgtForm,
                             //getForUpdate this is static function
                 //when this execute/button Edit is clicked/tap error
                 UpdateDataCust.getForUpdate(customer!.custId);
                           },
                           child: Row(mainAxisSize: MainAxisSize.min,
                               children: const <Widget>[
                                           Text('Edit', style: TextStyle(fontSize: 14)),
                                ]
                                 ),
                )
               )
          ),

          ]
        ),
      ),

    );
  }

}

file class CustomerWgtForm.dart
import 'package:flutter/material.dart';
import 'package:sfaf/database/entity/Customer.dart';
import 'package:sfaf/database/impl/CustomerImpl.dart';
import 'package:sfaf/view/screen/master/CustomerScreen.dart';
import 'dart:async';

TextEditingController custCodeController = TextEditingController();
TextEditingController custNameController = TextEditingController();
FocusNode custNameFocusNode = new FocusNode();

bool valueW1 = false;
bool valueW2 = false;
ValueNotifier<bool>  valueNotifierWeek1 = ValueNotifier<bool>(false);
StreamController<bool> streamController = StreamController<bool>();

class CustomerWgtForm extends StatefulWidget {
  @override
  _CustomerWgtFormState createState() => new _CustomerWgtFormState();

 }

class _CustomerWgtFormState extends State<CustomerWgtForm> {
  late FocusNode myFocusNode;

  //Call this function in subclass, Erorr
  changedWeek1(bool val) async {
       setState(() {
         valueW1=val;
      });
  }
  changedWeek2(bool val){ setState(() { valueW2=val; }); }

  @override
  void initState() {
      super.initState();
      myFocusNode = FocusNode();
  }
  @override
  void dispose() {
    myFocusNode.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
       return ListView(
       itemExtent: 700.0,
       shrinkWrap: true,
       scrollDirection: Axis.vertical,
       children: [
         Container(
           child: Stack(
            alignment: AlignmentDirectional.center,
                     children: <Widget>[
                                 Positioned( top: 10, left: 5, child:
                                           Text('Cust Code', textAlign: TextAlign.right,) ),
                                 Positioned( top: 3, left: 90,
                                   child:SizedBox(
                                     width: 100,height: 35,
                                             child: TextField(
                                                      controller: custCodeController,
                                                      decoration: InputDecoration(
                                                   enabledBorder: OutlineInputBorder(
                                                          borderSide: BorderSide(
                                                                    width: 1,
                                                                    color: Colors.blueGrey),),
                                                    focusedBorder: OutlineInputBorder(
                                                          borderSide: BorderSide(
                                                                    width: 1,
                                                                    color: Colors.amber),),
                                                       ),
                                             ),
                                    )
                                 ),
                                 Positioned(
                                     top:47,
                                    left: 5,
                                   child: Text('Cust Name') ),
                                 Positioned(
                                     top:44,
                                    left: 90,
                                   child:SizedBox(
                       width: 250,height: 35,
                                           child: TextField(
                                controller: custNameController,
                                                    decoration: InputDecoration(
                                  enabledBorder: OutlineInputBorder(
                                  borderSide: BorderSide(
                                                                      width: 1,
                                                                      color: Colors.blueGrey),),
                                                          focusedBorder: OutlineInputBorder(
                                                                      borderSide: BorderSide(
                                                                      width: 1,
                                                                      color: Colors.amber),),
                                                     ),
                                                     focusNode: custNameFocusNode,
                                          ),
                                  )
                                 ),

                    //WEEK VISITED use Checkbox widget
                    Positioned(
            top:406, left: 0,
                      child:SizedBox(
                      width: 270,height: 250,
                          child: Padding(
            padding: const EdgeInsets.all(9.0),
                              child: InputDecorator(
                         decoration: InputDecoration(
                          labelText: 'Week Visited',
                     labelStyle: TextStyle(
                                                  color: Colors.blue),
                                                 border: OutlineInputBorder(
                                                         borderRadius: BorderRadius.circular(5.0),
                                                ),

                                         contentPadding: EdgeInsets.all(10),
                                     ),
                                     child: Row(
                    mainAxisAlignment: MainAxisAlignment.start,
                                          children: [
                                              SizedBox(
                           height: 24.0, width: 24.0,
                                                child: Checkbox(
                                                          value: valueW1!,
                                                      onChanged: (bool? val) {
                                                         changedWeek1(val!);
                                                      },
                                                 )
                                               ),
                                               SizedBox(width: 2.0),
                                               Text("W1"),
                                               SizedBox(width: 10.0),
                                               SizedBox(
                        height: 24.0, width: 24.0,
                                                 child: Checkbox(
                                     value: valueW2,
                                                     onChanged: (bool? val) {
                                                        changedWeek2(val!);
                                                     },
                                                 )
                                               ),
                                               SizedBox(width: 2.0),
                           Text("W2"),
                           SizedBox(width: 10.0),
                                           ]
                                         ),
                                       ),
                                  ),
                         )
                  ),
              ]

  )
  ),
  ],
  );
  }

  }

  //function for reset widget TextField
 clear(){
     custCodeController.text="";
     custNameController.text="";
  }`

  //SUB CLASS
  //Sub class with static function will call in class CustomerWgtLV.dart
  class UpdateDataCust with ChangeNotifier  {
     static getForUpdate(String? custId) async  {
       try {
             SelectedIndexTabbar.setSelectedIndexTabbarCreateData();

             clear();
             Customer? customer = await CustomerImpl().getCustomerById(custId!.toString());
             custCodeController.text = customer!.custCode.toString();
             custNameController.text = customer!.custName.toString();

             CustomerWgtForm m= new CustomerWgtForm();

         //ERROOOOOOR
         //error in this line, while want to set Checkbox with true
             m.createState().changedWeek1(true);

       }
       catch (e) {
          print(e.toString());
       }
     }

 }

thanks


问:
Android Stripe Payment ：open "PaymentSheetActivity" ERROR(Java)
When I started using stripe payments, I followed the code of the stripe documentation.

But when running here it directly causes a crash, the same every time.

paymentSheet

paymentSheet.presentWithPaymentIntent(paymentIntentClientSecret, configuration)

This is the crash info:

```<code>2022-12-25 09:45:08.578 28671-28671/com.PangolinNetworkTechnologyCo.friskymeets E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.PangolinNetworkTechnologyCo.friskymeets, PID: 28671
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.PangolinNetworkTechnologyCo.friskymeets/com.stripe.android.paymentsheet.PaymentSheetActivity}: java.lang.IllegalArgumentException: Required value was null.
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3311)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3460)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2047)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:224)
        at android.app.ActivityThread.main(ActivityThread.java:7590)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
     Caused by: java.lang.IllegalArgumentException: Required value was null.
        at com.stripe.android.utils.CreationExtrasKtxKt.requireApplication(CreationExtrasKtx.kt:12)
        at com.stripe.android.paymentsheet.PaymentSheetViewModel$Factory.create(PaymentSheetViewModel.kt:608)
        at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.kt:187)
        at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.kt:153)
        at androidx.lifecycle.ViewModelLazy.getValue(ViewModelLazy.kt:53)
        at androidx.lifecycle.ViewModelLazy.getValue(ViewModelLazy.kt:35)
        at com.stripe.android.paymentsheet.PaymentSheetActivity.getViewModel(PaymentSheetActivity.kt:49)
        at com.stripe.android.paymentsheet.PaymentSheetActivity.getViewModel(PaymentSheetActivity.kt:38)
        at com.stripe.android.paymentsheet.ui.BaseSheetActivity.onCreate(BaseSheetActivity.kt:128)
        at com.stripe.android.paymentsheet.PaymentSheetActivity.onCreate(PaymentSheetActivity.kt:87)
        at android.app.Activity.performCreate(Activity.java:7893)
        at android.app.Activity.performCreate(Activity.java:7880)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3286)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3460)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2047)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:224)
        at android.app.ActivityThread.main(ActivityThread.java:7590)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
2022-12-25 09:45:11.789 28868-28868/? E/yCo.friskymeet: Unknown bits set in runtime_flags: 0x8000
</code>```

I tried this repeatedly reading the document, but all with the same result.
I use java.

https://stripe.com/docs/payments/accept-a-payment

Thank you!

Body:
When I started using stripe payments, I followed the code of the stripe documentation.

But when running here it directly causes a crash, the same every time.

paymentSheet

paymentSheet.presentWithPaymentIntent(paymentIntentClientSecret, configuration)

This is the crash info:

2022-12-25 09:45:08.578 28671-28671/com.PangolinNetworkTechnologyCo.friskymeets E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.PangolinNetworkTechnologyCo.friskymeets, PID: 28671
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.PangolinNetworkTechnologyCo.friskymeets/com.stripe.android.paymentsheet.PaymentSheetActivity}: java.lang.IllegalArgumentException: Required value was null.
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3311)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3460)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2047)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:224)
        at android.app.ActivityThread.main(ActivityThread.java:7590)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
     Caused by: java.lang.IllegalArgumentException: Required value was null.
        at com.stripe.android.utils.CreationExtrasKtxKt.requireApplication(CreationExtrasKtx.kt:12)
        at com.stripe.android.paymentsheet.PaymentSheetViewModel$Factory.create(PaymentSheetViewModel.kt:608)
        at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.kt:187)
        at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.kt:153)
        at androidx.lifecycle.ViewModelLazy.getValue(ViewModelLazy.kt:53)
        at androidx.lifecycle.ViewModelLazy.getValue(ViewModelLazy.kt:35)
        at com.stripe.android.paymentsheet.PaymentSheetActivity.getViewModel(PaymentSheetActivity.kt:49)
        at com.stripe.android.paymentsheet.PaymentSheetActivity.getViewModel(PaymentSheetActivity.kt:38)
        at com.stripe.android.paymentsheet.ui.BaseSheetActivity.onCreate(BaseSheetActivity.kt:128)
        at com.stripe.android.paymentsheet.PaymentSheetActivity.onCreate(PaymentSheetActivity.kt:87)
        at android.app.Activity.performCreate(Activity.java:7893)
        at android.app.Activity.performCreate(Activity.java:7880)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3286)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3460)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2047)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:224)
        at android.app.ActivityThread.main(ActivityThread.java:7590)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
2022-12-25 09:45:11.789 28868-28868/? E/yCo.friskymeet: Unknown bits set in runtime_flags: 0x8000

I tried this repeatedly reading the document, but all with the same result.
I use java.

https://stripe.com/docs/payments/accept-a-payment

Thank you!


问:
How to use flexbox to position images correctly the way I want?
just started to learn web design and I am having trouble with using flexbox. I have seen several answers from stack overflow that almost has what I want but apparently it is not working for me.

I want my images to lay out in two columns where the left column is full size, and the right column has two rows stacked on top of each other.

I tried something very similar to another answer I saw on stack overflow, but apparently it is not working with my images.

HTML:

```<code>      <div class="container">
        <div class="column">
          <div class="button rowspan">
            <a href="https://jason1chiu.github.io/accessibility-measures-met/">
              <img src="./assets/images/first-project.webp" class="first-project" alt="first-project">
              <div>
                <h3>1st Project</h3>
                <span>HTML/CSS</span>
              </div>
            </a>
          </div>
        </div>

        <div class="column">
          <div class="button">
            <a href="https://jason1chiu.github.io/accessibility-measures-met/">
              <img src="./assets/images/first-project.webp" class="new-project" alt="second-project">
              <div>
                <h3>2nd Project</h3>
                <span>HTML/CSS</span>
               </div>
            </a>
          </div>
          <div class="button">
            <a href="https://jason1chiu.github.io/accessibility-measures-met/">
              <img src="./assets/images/first-project.webp" class="new-project" alt="third-project">
              <div>
                <h3>3rd Project</h3>
                <span>HTML/CSS</span>
              </div>
            </a>
          </div>
        </div>
      </div>
</code>```
```<code>.container {
    display: flex;
    width: 100%;
    height: max-content;
    flex-wrap: column wrap;
}

.column {
    flex: ;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
}

.button {
    flex: 1;
    flex-wrap: wrap;
}

.button.rowspan {
    flex: 2;
    flex-wrap: wrap;
}

.first-project {
    padding: 20px 0 0 20px;
    width: 100%;
}

.new-project {
    padding: 20px 20px 0 20px;
    width: 100%;
    height: 50%;
}

</code>```

This is what I am trying to achieve:

What I Expect

But it is coming out like this:

What I have currently

Body:
just started to learn web design and I am having trouble with using flexbox. I have seen several answers from stack overflow that almost has what I want but apparently it is not working for me.

I want my images to lay out in two columns where the left column is full size, and the right column has two rows stacked on top of each other.

I tried something very similar to another answer I saw on stack overflow, but apparently it is not working with my images.

HTML:

1st Project

                HTML/CSS

2nd Project

                HTML/CSS

3rd Project

                HTML/CSS

.container {
    display: flex;
    width: 100%;
    height: max-content;
    flex-wrap: column wrap;
}

.column {
    flex: ;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
}

.button {
    flex: 1;
    flex-wrap: wrap;
}

.button.rowspan {
    flex: 2;
    flex-wrap: wrap;
}

.first-project {
    padding: 20px 0 0 20px;
    width: 100%;
}

.new-project {
    padding: 20px 20px 0 20px;
    width: 100%;
    height: 50%;
}

This is what I am trying to achieve:

What I Expect

But it is coming out like this:

What I have currently


问:
Sanity.io Uncaught Error: undefined is not an object (evaluating 'entry.borderBoxSize[0]')
I am new to Sanity and I am trying to setup some basic backend for my personal portfolio that I am building with NextJS and tailwindCSS. I am running into an uncaught error when I try to load up the desk plugin and I am so lost. Any help is appreciated!

Here are some screenshots of this uncaught error and what my sanity file looks like right now.


问:
php lifetime of cookie set to 1 results in unnatural date in browser?
As in theme setting lifetime of cookie to value 1 or 10 appears in strange result of year of date in cooke in browser, as follows:

```<code>setcookie(cookie_name, 'logout', 1, cookie_path, cookie_domain, cookie_secure, cookie_httponly );
</code>```

on 1 5838270

on 10 5838270

on 1000 the same

Didn't check with others, but it is strange result, why ?

Body:
As in theme setting lifetime of cookie to value 1 or 10 appears in strange result of year of date in cooke in browser, as follows:

setcookie(cookie_name, 'logout', 1, cookie_path, cookie_domain, cookie_secure, cookie_httponly );

on 1 5838270

on 10 5838270

on 1000 the same

Didn't check with others, but it is strange result, why ?