Skip to content

Commit

Permalink
Merge pull request #11 from dillonfagan/r/0.5
Browse files Browse the repository at this point in the history
R/0.5
  • Loading branch information
dillonfagan authored Nov 1, 2022
2 parents ec37b13 + 4412376 commit 651280d
Show file tree
Hide file tree
Showing 18 changed files with 62 additions and 32 deletions.
2 changes: 1 addition & 1 deletion lib/pages/timer/timer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class _TimerPageState extends State<TimerPage> {
String title = mob.isOnBreak ? 'Break' : currentMobber.name;

return Scaffold(
appBar: AppBarFactory.build(context: context, mob: mob),
appBar: AppBarFactory.build(context: context),
body: Center(
child: Column(
mainAxisSize: MainAxisSize.max,
Expand Down
25 changes: 18 additions & 7 deletions lib/pages/timer/widgets/appbar_factory.dart
Original file line number Diff line number Diff line change
@@ -1,21 +1,32 @@
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:mob_app/pages/setup/setup.dart';
import 'package:mob_app/pages/timer/widgets/end_mob_alert.dart';
import 'package:mob_app/providers/mob.dart';

class AppBarFactory {
static AppBar build({
required BuildContext context,
required MobProvider mob,
}) {
static AppBar build({required BuildContext context}) {
final mob = Provider.of<MobProvider>(context);

return AppBar(
backgroundColor: Colors.transparent,
elevation: 0,
leading: IconButton(
onPressed: () {
mob.reset();
Navigator.of(context).pop(MaterialPageRoute(
builder: (_) => const SetupPage(),
));
showDialog(
context: context,
builder: (context) {
return EndMobAlertDialog(
onConfirm: () {
Navigator.of(context).pop();
Navigator.of(context).pop(MaterialPageRoute(
builder: (_) => const SetupPage(),
));
},
);
},
);
},
icon: const Icon(Icons.close_rounded),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/timer/widgets/break_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class BreakButton extends StatelessWidget {
label: const Padding(
padding: EdgeInsets.fromLTRB(8, 0, 8, 0),
child: Text(
'Take a Break',
'Break',
style: TextStyle(fontSize: 36),
),
),
Expand Down
34 changes: 34 additions & 0 deletions lib/pages/timer/widgets/end_mob_alert.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import 'package:flutter/material.dart';

class EndMobAlertDialog extends StatelessWidget {
const EndMobAlertDialog({super.key, required this.onConfirm});

final Function() onConfirm;

@override
Widget build(BuildContext context) {
return AlertDialog(
title: const Text(
'End Mob',
textScaleFactor: 2,
),
actions: [
TextButton(
onPressed: () => Navigator.of(context).pop(),
style: TextButton.styleFrom(foregroundColor: Colors.grey.shade200),
child: const Text(
'Cancel',
textScaleFactor: 1.5,
),
),
TextButton(
onPressed: onConfirm,
child: const Text(
'End Mob',
textScaleFactor: 1.5,
),
),
],
);
}
}
Binary file added web/favicon.ico
Binary file not shown.
Binary file removed web/favicon.png
Binary file not shown.
Binary file removed web/icons/Icon-192.png
Binary file not shown.
Binary file removed web/icons/Icon-512.png
Binary file not shown.
Binary file removed web/icons/Icon-maskable-192.png
Binary file not shown.
Binary file removed web/icons/Icon-maskable-512.png
Binary file not shown.
1 change: 1 addition & 0 deletions web/icons/Icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/icons/android-chrome-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/icons/android-chrome-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/icons/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/icons/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/icons/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@

<meta charset="UTF-8">
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
<meta name="description" content="A new Flutter project.">
<meta name="description" content="Mob programming done simply.">

<!-- iOS meta tags & icons -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="mob_app">
<link rel="apple-touch-icon" href="icons/Icon-192.png">
<link rel="apple-touch-icon" href="icons/apple-touch-icon.png">

<!-- Favicon -->
<link rel="icon" type="image/png" href="favicon.png"/>
<link rel="icon" type="image/png" href="favicon.ico"/>

<title>mob_app</title>
<link rel="manifest" href="manifest.json">
Expand Down
24 changes: 4 additions & 20 deletions web/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,10 @@
"prefer_related_applications": false,
"icons": [
{
"src": "icons/Icon-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "icons/Icon-512.png",
"sizes": "512x512",
"type": "image/png"
},
{
"src": "icons/Icon-maskable-192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "icons/Icon-maskable-512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
"src": "icons/Icon.svg",
"sizes": "any",
"type": "image/svg+xml",
"purpose": "any"
}
]
}

0 comments on commit 651280d

Please sign in to comment.