Git Product home page Git Product logo

Comments (7)

TheAlphamerc avatar TheAlphamerc commented on August 23, 2024 1

Yes getUserName({String name, String id}) method is in utility class but it is called from AuthState class to create username.

from flutter_twitter_clone.

TheAlphamerc avatar TheAlphamerc commented on August 23, 2024

The random end is necessary at signup process to avoid duplicacy in username. If you still don't want random end then ask user to enter a suitable username and you have to make sure that the same username does not exist in the database.

from flutter_twitter_clone.

gulmensedat avatar gulmensedat commented on August 23, 2024

The random end is necessary at signup process to avoid duplicacy in username. If you still don't want random end then ask user to enter a suitable username and you have to make sure that the same username does not exist in the database.

I have not yet found where to remove it?

from flutter_twitter_clone.

TheAlphamerc avatar TheAlphamerc commented on August 23, 2024

When a user creates a new account by doing email signup or signup through g-mail, a new user is created at firebase and then his username is created using his name and firebase user id. You can find this code at lib > state > authState.dart
Screenshot 2020-04-21 at 9 28 17 AM

from flutter_twitter_clone.

gulmensedat avatar gulmensedat commented on August 23, 2024

When a user creates a new account by doing email signup or signup through g-mail, a new user is created at firebase and then his username is created using his name and firebase user id. You can find this code at lib > state > authState.dart
Screenshot 2020-04-21 at 9 28 17 AM

No, this is. helper > utility.dart

String getUserName({String name, String id}) {
String userName = '';
name = name.split(' ')[0];
id = id.substring(0, 4).toLowerCase();
userName = '@$name$id';
return userName;
}

userName = '@$name$id';

from flutter_twitter_clone.

qwerty684 avatar qwerty684 commented on August 23, 2024

Yes getUserName({String name, String id}) method is in utility class but it is called from AuthState class to create username.

I create text input in signup page with name "userName"
how can I connect this userName impute with this code here?

String getUserName({String name, String id}) {
String userName = '';
name = name.split(' ')[0];
id = id.substring(0, 4).toLowerCase();
userName = '@$name$id';
return userName;
}

from flutter_twitter_clone.

TheAlphamerc avatar TheAlphamerc commented on August 23, 2024

@emiravdovic when you click on the submit button call this method by passing username text and some id to it and it will return a combination of username and id.

String username = "Emiravdovic";
String id = "abcd1234;
final usernameForDb = Utility.getUsername(name:username, id:id);
print(username);

from flutter_twitter_clone.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.