fixed issue #4
This commit is contained in:
@@ -1,9 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:frontend/provider/quote_provider.dart';
|
import 'package:frontend/provider/quote_provider.dart';
|
||||||
|
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
import 'package:frontend/values/strings.dart';
|
import 'package:frontend/values/strings.dart';
|
||||||
import 'package:frontend/values/constants.dart';
|
import 'package:frontend/values/constants.dart';
|
||||||
|
|
||||||
@@ -13,6 +10,9 @@ class FlashcardsPage extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final provider = Provider.of<QuoteProvider>(context);
|
final provider = Provider.of<QuoteProvider>(context);
|
||||||
|
|
||||||
|
final screenWidth = MediaQuery.of(context).size.width;
|
||||||
|
|
||||||
return Card(
|
return Card(
|
||||||
margin: const EdgeInsets.all(Constants.edgeInset),
|
margin: const EdgeInsets.all(Constants.edgeInset),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
@@ -20,43 +20,65 @@ class FlashcardsPage extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
children: [
|
||||||
|
const Spacer(),
|
||||||
|
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(Constants.edgeInset*2),
|
padding: const EdgeInsets.all(Constants.edgeInset),
|
||||||
child: Text(provider.randomQuoteText,
|
child: Text(
|
||||||
|
provider.randomQuoteText,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 35,
|
fontSize: screenWidth * 0.06, // responsive text
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
const Spacer(),
|
||||||
|
|
||||||
|
// Buttons side by side
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Expanded(
|
||||||
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(Constants.edgeInset),
|
padding: const EdgeInsets.all(Constants.edgeInset),
|
||||||
child: TextButton.icon(
|
child: TextButton.icon(
|
||||||
onPressed: provider.flipRandomQuote,
|
onPressed: provider.flipRandomQuote,
|
||||||
icon: Icon(Icons.repeat,
|
icon: const Icon(
|
||||||
size: 35,
|
Icons.repeat,
|
||||||
|
size: 28,
|
||||||
),
|
),
|
||||||
label: Text(Strings.flipFlashcard,
|
label: Text(
|
||||||
|
Strings.flipFlashcard,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 35,
|
fontSize: screenWidth * 0.045,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
style: TextButton.styleFrom(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Expanded(
|
||||||
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(Constants.edgeInset),
|
padding: const EdgeInsets.all(Constants.edgeInset),
|
||||||
child: TextButton.icon(
|
child: TextButton.icon(
|
||||||
onPressed: provider.nextRandomQuote,
|
onPressed: provider.nextRandomQuote,
|
||||||
icon: Icon(Icons.arrow_right_alt,
|
icon: const Icon(
|
||||||
size: 35,
|
Icons.arrow_right_alt,
|
||||||
|
size: 28,
|
||||||
),
|
),
|
||||||
label: Text(Strings.nextFlashcard,
|
label: Text(
|
||||||
|
Strings.nextFlashcard,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 35,
|
fontSize: screenWidth * 0.045,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
style: TextButton.styleFrom(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user