2022年11月17日星期四

Flutter Web submit form on enter key

 For a TextFormField the property to handle this would be onFieldSubmitted. You can copy the code from your onPressed of the RaiseButton to this. For e.g.

onFieldSubmitted: (value) {
                if (_formKey.currentState.validate()) {
                  _formKey.currentState.save();
//               var result = await auth.sendPasswordResetEmail(_email);
//               print(result);
                  print(_email);
                  Navigator.of(context).pop();
                }
              },

2022年11月14日星期一

flutter build web

 48

[UPDATE]

To create a production build for web, you can now directly run flutter build web command similar to other platforms (android and ios) and you will see build/web folder generated with the assets folder and you can simply deploy it on your server.

[OLD ANSWER STEP 1 & 2 No longer required ]

you need to do a production build by using a webdev tool, To install webdev you need a pub tool.

  1. so go to the location where you have dart SDK installed and inside the bin folder you should have a pub batch file. You need to provide the bin folder's path to the environment variable in order to use pub from cmd.

  2. open cmd/terminal run the below command to install webdev

    pub global activate webdev

  3. now go to the root folder of your project and do a build in release mode

    flutter build web

  4. you should see a build folder (/build/web) in the root directory, just copy that folder and host it on a web server.



Remove this Line or remove '/' from the href attribute.

<base href="/">

None of your spec sources contain a spec satisfying the dependency: `Firebase/CoreOnly (= 9.6.0)`.

 cd ios


pod install --repo-update

2022年11月3日星期四

get system locale language

 Locale myLocale = Localizations.localeOf(context);

print('my locale: '+myLocale.toString().toLowerCase());