import 'package:flutter/material.dart';
void main() {
runApp(
MaterialApp(
home: LogInScreen(),
),
);
}
class LogInScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Log in'),
),
body: SafeArea(
child: LayoutBuilder(
builder: (context, constraints) {
return SingleChildScrollView(
child: ConstrainedBox(
constraints: BoxConstraints(minHeight: constraints.maxHeight),
child: Padding(
padding: const EdgeInsets.all(32.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
TextField(
controller: null,
decoration: InputDecoration(
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8.0),
),
labelText: 'mail address',
),
),
const SizedBox(height: 24.0),
TextField(
controller: null, // Controller実装必要
decoration: InputDecoration(
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8.0),
),
labelText: 'password',
),
),
],
),
Container(
width: double.infinity,
height: 54.0,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.0),
),
child: TextButton(
style: ButtonStyle(
backgroundColor:
MaterialStateProperty.all(Colors.blue),
foregroundColor:
MaterialStateProperty.all(Colors.white),
),
onPressed: () {
// ボタン処理
},
child: const Text('Log in'),
),
),
],
),
),
),
);
},
),
),
);
}
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.