Untitled
unknown
dart
2 years ago
2.8 kB
36
Indexable
//constant
const kTextFieldDecoration = InputDecoration(
hintText: 'Enter a value',
contentPadding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 20.0),
border: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(32.0)),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.blueAccent, width: 1.0),
borderRadius: BorderRadius.all(Radius.circular(32.0)),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.blueAccent, width: 2.0),
borderRadius: BorderRadius.all(Radius.circular(32.0)),
),
);
//welcome.dart
import 'package:flutter/material.dart';
class WelcomePage extends StatefulWidget {
const WelcomePage({super.key});
@override
State<WelcomePage> createState() => _WelcomePageState();
}
class _WelcomePageState extends State<WelcomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Container(
margin: EdgeInsets.all(30),
padding: EdgeInsets.all(20),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'bmi',
style: kTitleTextStyle,
),
Text(
'calculator',
style: kLabelTextStyle,
)
],
),
SizedBox(
height: 60,
),
Material(
elevation: 5.0,
color: Colors.blueGrey,
borderRadius: BorderRadius.circular(30.0),
child: MaterialButton(
minWidth: MediaQuery.of(context).size.width,
height: 50,
onPressed: () {},
child: Text(
'Masuk',
),
),
),
SizedBox(
height: 20,
),
Material(
elevation: 5.0,
color: Colors.greenAccent,
borderRadius: BorderRadius.circular(30.0),
child: MaterialButton(
minWidth: MediaQuery.of(context).size.width,
height: 50,
onPressed: () {},
child: Text(
'Daftar',
),
),
),
],
),
),
),
);
}
}
// firebase
//android/buildgradle
classpath 'com.google.gms:google-services:4.3.15'
//android/app/buildgradle
apply plugin: 'com.google.gms.google-services'
implementation"com.google.firebase:firebase-bom:32.2.0"Editor is loading...