Skip to content

Commit

Permalink
Merge pull request #11 from intoinside:intoinside/issue10
Browse files Browse the repository at this point in the history
Intoinside/issue10
  • Loading branch information
intoinside authored Feb 20, 2024
2 parents 1eaec13 + d4c520e commit 6c2a848
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 10 deletions.
4 changes: 2 additions & 2 deletions assets/proverbs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ He who lives hoping dies shitting-Chi vive sperando muore cagando
Don't say cat if you don't have it in the bag-Non dire gatto se non ce l'hai nel sacco
An apple a day keeps the doctor away-Una mela al giorno toglie il medico di torno
The tongue hits where the tooth is in pain-La lingua batte dove il dente duole
If my grandmother had wheels, she would be a barrow
If my grandmother had wheels, she would be a barrow-Se mia nonna aveva le ruote, sarebbe stata una cariola
Knight with two ladies should have a beautiful sausage-Cavalier con due dame deve aver un bel salame
If my grandfather had three balls, he would be a flipper
If my grandfather had three balls, he would be a flipper-Se mio nonna aveva tre palle, sarebbe stato un flipper
29 changes: 22 additions & 7 deletions lib/screens/main_page_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class _MainPageScreenState extends State<MainPageScreen> {
var x = sin(hour * pi / 24) * 80;

colorShade1 = Color.fromARGB(255, 30, 30, 70 + x.ceil());
colorShade2 = colorShade1!.withBlue(colorShade1!.blue - 40);
colorShade2 = colorShade1!.withBlue(colorShade1!.blue - 60);
colorTranslation = colorShade2!.withRed(20);
}

Expand All @@ -47,7 +47,7 @@ class _MainPageScreenState extends State<MainPageScreen> {
var splittedData = LineSplitter.split(loadedData);

var dayOfYear = int.parse(DateFormat('D').format(DateTime.now()));
var randNum = dayOfYear % splittedData.length;
var randNum = Random(dayOfYear).nextInt(splittedData.length);

var data = splittedData.elementAt(randNum);

Expand All @@ -58,7 +58,7 @@ class _MainPageScreenState extends State<MainPageScreen> {

void _setupFolder() async {
var directory = await getApplicationDocumentsDirectory();
pathOfImage = await File('${directory.path}/legendary.png').create();
pathOfImage = await File('${directory.path}/proverb.png').create();
}

@override
Expand Down Expand Up @@ -90,15 +90,30 @@ class _MainPageScreenState extends State<MainPageScreen> {
),
child: Column(
children: [
Container(height: 100),
proverbWidget,
Container(height: 60),
Container(height: 70),
translationWidget,
Container(height: 160),
Text(
"Check on Play Store®",
textAlign: TextAlign.center,
style: Theme.of(context)
.textTheme
.bodyMedium!
.copyWith(
color:
Theme.of(context).colorScheme.onPrimary,
fontSize: 16),
),
],
)))
.then((capturedImage) {
final Uint8List bytes = capturedImage.buffer.asUint8List();
pathOfImage!.writeAsBytes(bytes).whenComplete(
() => Share.shareXFiles([XFile(pathOfImage!.path)]));
pathOfImage!.writeAsBytes(bytes).whenComplete(() =>
Share.shareXFiles([XFile(pathOfImage!.path)],
subject: "Share your proverb!",
text: "Share your proverb!"));
});
},
foregroundColor: Theme.of(context).colorScheme.onPrimary,
Expand All @@ -120,7 +135,7 @@ class _MainPageScreenState extends State<MainPageScreen> {
child: Column(
children: [
proverbWidget,
Container(height: 80),
Container(height: 30),
IconButton(
tooltip: "What does it means?",
onPressed: () {
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/proverb_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class _ProverbWidgetState extends State<ProverbWidget> {

return Column(
children: [
Container(height: 30),
Container(height: 36),
Text(
title,
textAlign: TextAlign.center,
Expand Down

0 comments on commit 6c2a848

Please sign in to comment.