74 lines
2.4 KiB
Dart
74 lines
2.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import 'package:frontend/provider/quote_provider.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:frontend/values/strings.dart';
|
|
import 'package:frontend/values/constants.dart';
|
|
|
|
class FlashcardsPage extends StatelessWidget {
|
|
const FlashcardsPage({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
//return const Center(child: Text('flashcards! flip flip'));
|
|
final provider = Provider.of<QuoteProvider>(context);
|
|
if (provider.randomQuoteText == "dummy" ||
|
|
provider.randomQuoteText == "quote text") { provider.nextRandomQuote(); } // initialize the random quote variable
|
|
return Card(
|
|
margin: const EdgeInsets.all(Constants.edgeInset),
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(Constants.edgeInset),
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
Padding(
|
|
padding: const EdgeInsets.all(Constants.edgeInset*2),
|
|
child: Text(provider.randomQuoteText,
|
|
style: TextStyle(
|
|
fontSize: 35,
|
|
),
|
|
),
|
|
),
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
Padding(
|
|
padding: const EdgeInsets.all(Constants.edgeInset),
|
|
child: TextButton.icon(
|
|
onPressed: provider.flipRandomQuote,
|
|
icon: Icon(Icons.repeat,
|
|
size: 35,
|
|
),
|
|
label: Text(Strings.flipFlashcard,
|
|
style: TextStyle(
|
|
fontSize: 35,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
Padding(
|
|
padding: const EdgeInsets.all(Constants.edgeInset),
|
|
child: TextButton.icon(
|
|
onPressed: provider.nextRandomQuote,
|
|
icon: Icon(Icons.arrow_right_alt,
|
|
size: 35,
|
|
),
|
|
label: Text(Strings.nextFlashcard,
|
|
style: TextStyle(
|
|
fontSize: 35,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
} |