diff --git a/lib/main.dart b/lib/main.dart index 3e19704..4499bdd 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -import 'package:fooder_web/screens/login.dart'; -import 'package:fooder_web/client.dart'; +import 'package:fooder/screens/login.dart'; +import 'package:fooder/client.dart'; class MyApp extends StatelessWidget { diff --git a/lib/models/diary.dart b/lib/models/diary.dart index 232d82b..8716c91 100644 --- a/lib/models/diary.dart +++ b/lib/models/diary.dart @@ -1,4 +1,4 @@ -import 'package:fooder_web/models/meal.dart'; +import 'package:fooder/models/meal.dart'; class Diary { diff --git a/lib/models/entry.dart b/lib/models/entry.dart index 84622ba..ba27139 100644 --- a/lib/models/entry.dart +++ b/lib/models/entry.dart @@ -1,4 +1,4 @@ -import 'package:fooder_web/models/product.dart'; +import 'package:fooder/models/product.dart'; class Entry { final int id; diff --git a/lib/models/meal.dart b/lib/models/meal.dart index 5bf9bc3..212e052 100644 --- a/lib/models/meal.dart +++ b/lib/models/meal.dart @@ -1,4 +1,4 @@ -import 'package:fooder_web/models/entry.dart'; +import 'package:fooder/models/entry.dart'; class Meal { diff --git a/lib/screens/add_entry.dart b/lib/screens/add_entry.dart index 5420943..429fee7 100644 --- a/lib/screens/add_entry.dart +++ b/lib/screens/add_entry.dart @@ -1,11 +1,11 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:fooder_web/screens/based.dart'; -import 'package:fooder_web/models/product.dart'; -import 'package:fooder_web/models/diary.dart'; -import 'package:fooder_web/models/meal.dart'; -import 'package:fooder_web/widgets/product.dart'; -import 'package:fooder_web/screens/add_product.dart'; +import 'package:fooder/screens/based.dart'; +import 'package:fooder/models/product.dart'; +import 'package:fooder/models/diary.dart'; +import 'package:fooder/models/meal.dart'; +import 'package:fooder/widgets/product.dart'; +import 'package:fooder/screens/add_product.dart'; class AddEntryScreen extends BasedScreen { diff --git a/lib/screens/add_meal.dart b/lib/screens/add_meal.dart index 3789bd3..4e2a2ee 100644 --- a/lib/screens/add_meal.dart +++ b/lib/screens/add_meal.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -import 'package:fooder_web/screens/based.dart'; -import 'package:fooder_web/models/diary.dart'; +import 'package:fooder/screens/based.dart'; +import 'package:fooder/models/diary.dart'; class AddMealScreen extends BasedScreen { diff --git a/lib/screens/add_product.dart b/lib/screens/add_product.dart index c68fe72..8f3268b 100644 --- a/lib/screens/add_product.dart +++ b/lib/screens/add_product.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:fooder_web/screens/based.dart'; -import 'package:fooder_web/models/product.dart'; +import 'package:fooder/screens/based.dart'; +import 'package:fooder/models/product.dart'; class AddProductScreen extends BasedScreen { diff --git a/lib/screens/based.dart b/lib/screens/based.dart index 9a25f6e..9f05af4 100644 --- a/lib/screens/based.dart +++ b/lib/screens/based.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:fooder_web/client.dart'; +import 'package:fooder/client.dart'; abstract class BasedScreen extends StatefulWidget { diff --git a/lib/screens/edit_entry.dart b/lib/screens/edit_entry.dart index db27510..d57b2d2 100644 --- a/lib/screens/edit_entry.dart +++ b/lib/screens/edit_entry.dart @@ -1,10 +1,10 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:fooder_web/screens/based.dart'; -import 'package:fooder_web/models/product.dart'; -import 'package:fooder_web/models/entry.dart'; -import 'package:fooder_web/widgets/product.dart'; -import 'package:fooder_web/screens/add_product.dart'; +import 'package:fooder/screens/based.dart'; +import 'package:fooder/models/product.dart'; +import 'package:fooder/models/entry.dart'; +import 'package:fooder/widgets/product.dart'; +import 'package:fooder/screens/add_product.dart'; class EditEntryScreen extends BasedScreen { diff --git a/lib/screens/login.dart b/lib/screens/login.dart index a244088..ae3d9b5 100644 --- a/lib/screens/login.dart +++ b/lib/screens/login.dart @@ -1,7 +1,8 @@ import 'package:flutter/material.dart'; -import 'package:fooder_web/screens/based.dart'; -import 'package:fooder_web/screens/main.dart'; -import 'package:fooder_web/screens/register.dart'; +import 'package:flutter/services.dart'; +import 'package:fooder/screens/based.dart'; +import 'package:fooder/screens/main.dart'; +import 'package:fooder/screens/register.dart'; class LoginScreen extends BasedScreen { @@ -69,6 +70,13 @@ class _LoginScreen extends State { @override void initState () { super.initState(); + SystemChannels.textInput.invokeMethod('TextInput.setClientFeatures', { + 'setAuthenticationConfiguration': true, + 'setAutofillHints': [ + AutofillHints.username, + AutofillHints.password, + ], + }); _asyncInitState().then((value) => null); } @@ -105,6 +113,7 @@ class _LoginScreen extends State { labelText: 'Username', ), controller: usernameController, + autofillHints: const [AutofillHints.username], ), TextFormField( obscureText: true, @@ -112,7 +121,8 @@ class _LoginScreen extends State { labelText: 'Password', ), controller: passwordController, - onFieldSubmitted: (_) => _login() + onFieldSubmitted: (_) => _login(), + autofillHints: const [AutofillHints.password], ), Padding( padding: const EdgeInsets.symmetric(vertical: 10), diff --git a/lib/screens/main.dart b/lib/screens/main.dart index b351175..76a50e2 100644 --- a/lib/screens/main.dart +++ b/lib/screens/main.dart @@ -1,9 +1,9 @@ import 'package:flutter/material.dart'; -import 'package:fooder_web/screens/based.dart'; -import 'package:fooder_web/screens/login.dart'; -import 'package:fooder_web/screens/add_entry.dart'; -import 'package:fooder_web/models/diary.dart'; -import 'package:fooder_web/widgets/diary.dart'; +import 'package:fooder/screens/based.dart'; +import 'package:fooder/screens/login.dart'; +import 'package:fooder/screens/add_entry.dart'; +import 'package:fooder/models/diary.dart'; +import 'package:fooder/widgets/diary.dart'; class MainScreen extends BasedScreen { diff --git a/lib/screens/register.dart b/lib/screens/register.dart index 4ae3fac..d762981 100644 --- a/lib/screens/register.dart +++ b/lib/screens/register.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; -import 'package:fooder_web/screens/based.dart'; +import 'package:flutter/services.dart'; +import 'package:fooder/screens/based.dart'; class RegisterScreen extends BasedScreen { @@ -23,6 +24,18 @@ class _RegisterScreen extends State { super.dispose(); } + @override + void initState() { + super.initState(); + SystemChannels.textInput.invokeMethod('TextInput.setClientFeatures', { + 'setAuthenticationConfiguration': true, + 'setAutofillHints': [ + AutofillHints.username, + AutofillHints.password, + ], + }); + } + void showError(String message) { ScaffoldMessenger.of(context).showSnackBar( @@ -85,6 +98,7 @@ class _RegisterScreen extends State { labelText: 'Username', ), controller: usernameController, + autofillHints: const [AutofillHints.username], ), TextFormField( obscureText: true, @@ -92,6 +106,7 @@ class _RegisterScreen extends State { labelText: 'Password', ), controller: passwordController, + autofillHints: const [AutofillHints.password], ), TextFormField( obscureText: true, diff --git a/lib/widgets/diary.dart b/lib/widgets/diary.dart index d6c2cb8..1bd77b3 100644 --- a/lib/widgets/diary.dart +++ b/lib/widgets/diary.dart @@ -1,9 +1,9 @@ import 'package:flutter/material.dart'; -import 'package:fooder_web/models/diary.dart'; -import 'package:fooder_web/widgets/meal.dart'; -import 'package:fooder_web/widgets/macro.dart'; -import 'package:fooder_web/client.dart'; -import 'package:fooder_web/screens/add_meal.dart'; +import 'package:fooder/models/diary.dart'; +import 'package:fooder/widgets/meal.dart'; +import 'package:fooder/widgets/macro.dart'; +import 'package:fooder/client.dart'; +import 'package:fooder/screens/add_meal.dart'; import 'dart:core'; diff --git a/lib/widgets/entry.dart b/lib/widgets/entry.dart index 5b2ea19..a7daab0 100644 --- a/lib/widgets/entry.dart +++ b/lib/widgets/entry.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -import 'package:fooder_web/models/entry.dart'; -import 'package:fooder_web/widgets/macro.dart'; +import 'package:fooder/models/entry.dart'; +import 'package:fooder/widgets/macro.dart'; import 'dart:core'; diff --git a/lib/widgets/meal.dart b/lib/widgets/meal.dart index 542884b..a4f3ac2 100644 --- a/lib/widgets/meal.dart +++ b/lib/widgets/meal.dart @@ -1,9 +1,9 @@ import 'package:flutter/material.dart'; -import 'package:fooder_web/models/meal.dart'; -import 'package:fooder_web/widgets/entry.dart'; -import 'package:fooder_web/widgets/macro.dart'; -import 'package:fooder_web/screens/edit_entry.dart'; -import 'package:fooder_web/client.dart'; +import 'package:fooder/models/meal.dart'; +import 'package:fooder/widgets/entry.dart'; +import 'package:fooder/widgets/macro.dart'; +import 'package:fooder/screens/edit_entry.dart'; +import 'package:fooder/client.dart'; import 'dart:core'; diff --git a/lib/widgets/product.dart b/lib/widgets/product.dart index c434087..54e70ec 100644 --- a/lib/widgets/product.dart +++ b/lib/widgets/product.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -import 'package:fooder_web/models/product.dart'; -import 'package:fooder_web/widgets/macro.dart'; +import 'package:fooder/models/product.dart'; +import 'package:fooder/widgets/macro.dart'; import 'dart:core'; diff --git a/pubspec.yaml b/pubspec.yaml index f6e95ed..3c67c8e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ -name: fooder_web -description: A new Flutter project. +name: fooder +description: FOODER - no bloat food diary # The following line prevents the package from being accidentally published to # pub.dev using `flutter pub publish`. This is preferred for private packages. publish_to: 'none' # Remove this line if you wish to publish to pub.dev