main.dart

mail@pastecode.io avatar
unknown
dart
2 years ago
3.0 kB
12
Indexable
import 'package:flutter/material.dart';

void main() {
  runApp( MyApp());
}

class MyApp extends StatelessWidget {
  MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: SafeArea(
        child: Scaffold(
          backgroundColor: Colors.blue,
          body: SoruPage(),
        ),
      ),
    );
  }
}

class SoruPage extends StatefulWidget {
  SoruPage({super.key});
  List<Widget> secimler = [
    dogruIconu,
    yanlisIconu,
    dogruIconu,
    yanlisIconu,
    yanlisIconu
  ];

  @override
  State<SoruPage> createState() => _SoruPageState();
}

class _SoruPageState extends State<SoruPage> {
  @override
  Widget build(BuildContext context) {
    return Column(
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
      crossAxisAlignment: CrossAxisAlignment.stretch,
      children: <Widget>[       
       Expanded(
          flex: 4,
          child: Padding(
            padding: EdgeInsets.all(10.0),
            child: Center(
              child: Text(
                'Bilgi Testi Soruları',
                textAlign: TextAlign.center,
                style: TextStyle(
                  fontSize: 20.0,
                  color: Colors.white,
                ),
              ),
            ),
          ),
        ),
        Row(children: [secimler],),
        Expanded(
          flex: 1,
          child: Padding(
            padding: EdgeInsets.symmetric(horizontal: 6.0),
            child: Row(
              children: <Widget>[
                Expanded(
                  child: Padding(
                    padding: EdgeInsets.symmetric(horizontal: 6),
                    child: ElevatedButton(
                      style: ButtonStyle(
                        backgroundColor:
                            MaterialStatePropertyAll<Color>(Colors.red),
                      ),
                      child: Icon(
                        Icons.thumb_down,
                        color: Colors.white,
                        
                      ),
                      onPressed: () {},
                    ),
                  ),
                ),
                Expanded(
                  child: Padding(
                    padding: EdgeInsets.symmetric(horizontal: 6),
                    child: ElevatedButton(
                      style:  ButtonStyle(
                        backgroundColor:
                            MaterialStatePropertyAll<Color>(Colors.green),
                      ),
                      child: Icon(
                        Icons.thumb_up,
                        color: Colors.white,
                      ),
                      onPressed: () => (() {}),
                    ),
                  ),
                ),
              ],
            ),
          ),
        )
      ],
    );
  }
}

var dogruIconu = Icon(Icons.mood, color: Colors.green,);
var yanlisIconu = Icon(Icons.mood_bad_outlined);