TextField(
style: TextStyle(
color: Colors.black,
),
decoration: InputDecoration(
filled: true,
fillColor: Colors.white,
icon: Icon(
Icons.location_city,
color: Colors.white,
),
hintText: 'Enter Name',
hintStyle: TextStyle(
color: Colors.grey,
),
border: OutlineInputBorder(
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
borderSide: BorderSide.none,
),
),
),
Archive for: 月 2020’
Flutter TextField Decoration サンプル
Flutter TextField のテーマサンプル
Theme(
data: Theme.of(context).copyWith(splashColor: Colors.transparent),
child: TextField(
autofocus: false,
style: TextStyle(fontSize: 22.0, color: Color(0xFFbdc6cf)),
decoration: InputDecoration(
filled: true,
fillColor: Colors.white,
hintText: 'Username',
contentPadding:
const EdgeInsets.only(left: 14.0, bottom: 8.0, top: 8.0),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.white),
borderRadius: BorderRadius.circular(25.7),
),
enabledBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Colors.white),
borderRadius: BorderRadius.circular(25.7),
),
),
),
);
Flutter Firebase Authenticationの操作
Firebase Authenticationへの登録
FirebaseAuth firebaseAuth = FirebaseAuth.instance;
DatabaseReference dbRef = FirebaseDatabase.instance.reference().child('Users');
firebaseAuth
.createUserWithEmailAndPassword(
email: emailController.text,
password: passwordController.text).then((result){
dbRef.child(result.user.uid).set({
'email': emailController.text,
})
Firebase Authenticationへのログイン
FirebaseAuth firebaseAuth = FirebaseAuth.instance;
firebaseAuth.signInWithEmailAndPassword(
email: emailController.text,
password: passwordController.text)
.then((result){
Navigator.pushReplacement(
context,
MaterialPageRoute(builder: (context) => HomePage(uid: result.user.uid)),
);
})
Firebase Authentication存在確認
FirebaseAuth.instance.currentUser().then((response) { }
Firebase Authenticationログアウト
FirebaseAuth auth = FirebaseAuth.instance;
auth.signOut().then((response){}