//import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData.dark().copyWith( // ANA TEMA AYARI
brightness: Brightness.dark,
primaryColor: Colors.red, // APP BAR VE ÜSTÜ ALANI BOYAR
accentColor: Colors.amber, // BUTON RENKLERİ
scaffoldBackgroundColor: Colors.black
),
home: InputPage(),
);
}
}
class InputPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(
"YAŞAM BEKLENTİSİ",
style: TextStyle(color: Colors.black87),
),
centerTitle: true,
),
body: Center(
child: Text(
"Form Alanı",
style: TextStyle(
fontSize: 16,
color: Colors.black87,
),
),
),
//BUTON RENGİNİ ÜST WİDGET PRİMARYCOLORDAN AL
floatingActionButton: Theme(data: ThemeData(accentColor: Theme.of(context).primaryColor),
child: FloatingActionButton(
onPressed: (){},
child: Icon(Icons.add),
),
),
);
}
}