removed unused pages

This commit is contained in:
BroodjeAap 2020-12-28 15:51:37 +01:00
parent fe603a65a5
commit 56aa8ff6f8
5 changed files with 0 additions and 427 deletions

View file

@ -118,21 +118,12 @@ class RouteGenerator {
case "/": {
return MaterialPageRoute(builder: (context) => PracticeSetupPage());
}
case "/monthValues": {
return MaterialPageRoute(builder: (context) => MonthValuesPage());
}
case "/years": {
return MaterialPageRoute(builder: (context) => YearsPage());
}
case "/practice/setup": {
return MaterialPageRoute(builder: (context) => PracticeSetupPage());
}
case "/practice/practice": {
return MaterialPageRoute(builder: (context) => PracticePage(settings.arguments));
}
case "/notifications": {
return MaterialPageRoute(builder: (context) => NotificationsPage());
}
case "/instructions/month": {
return MaterialPageRoute(builder: (context) => MonthInstructionPage());
}

View file

@ -11,27 +11,6 @@ class AppDrawer extends StatelessWidget {
DrawerHeader(
child: Text("Oh That's A ..."),
),
ListTile(
title: Text("Month values"),
onTap: () {
Navigator.pop(context);
Navigator.pushNamed(context, "/monthValues");
}
),
ListTile(
title: Text("Years"),
onTap: () {
Navigator.pop(context);
Navigator.pushNamed(context, "/years");
}
),
ListTile(
title: Text("Notifications"),
onTap: () {
Navigator.pop(context);
Navigator.pushNamed(context, "/notifications");
}
),
ListTile(
title: Text("Practice"),
onTap: () {

View file

@ -1,224 +0,0 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:numberpicker/numberpicker.dart';
import 'package:ohthatsa/other/AppDrawer.dart';
import 'package:ohthatsa/util/DayCalculator.dart';
import 'package:term_glyph/term_glyph.dart' as glyph;
class MonthValuesPage extends StatefulWidget {
@override
_MonthValuesState createState() => _MonthValuesState();
}
class _MonthValuesState extends State<MonthValuesPage> {
int year;
int yy;
String centuriesString;
String yyString;
double yyDiv4;
int yyDiv4Floored;
int yearValue;
@override
void initState(){
super.initState();
this.setYearValues(DateTime.now().year);
}
void setYearValues(newYear){
year = newYear;
yy = year % 100;
centuriesString = (year ~/ 100).toString();
yyString = year.toString().substring(2);
yyDiv4 = yy / 4;
yyDiv4Floored = yyDiv4.floor();
yearValue = DayCalculator.getYearValue(year);
setState(() {});
}
static const formulaStyle = TextStyle(
fontSize: 20
);
static const formulaStyleU = TextStyle(
fontSize: 20,
decoration: TextDecoration.underline
);
static const YYStyle = TextStyle(
color: Colors.green,
fontSize: 20
);
static const YYStyleU = TextStyle(
color: Colors.green,
fontSize: 20,
decoration: TextDecoration.underline
);
static const pageNum = TextStyle(
color: Colors.grey,
fontSize: 20
);
static const pageNumCurrent = TextStyle(
color: Colors.blue,
fontSize: 20
);
@override
Widget build(BuildContext context) {
return Scaffold(
drawer: AppDrawer(),
appBar: AppBar(
title: Text("Month Values")
),
body: PageView(
children: <Widget>[
Container(
padding: EdgeInsets.fromLTRB(0, 50, 0, 10),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Text(
"Take only the last two digits: ",
style: TextStyle(fontSize: 25)
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
"YY",
style: TextStyle(
color: Colors.grey,
fontSize: 25
)
),
Text(
"YY",
style: YYStyle
)
],
),
Text(
"Calculate:",
style: TextStyle(fontSize: 25)
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
"(",
style: formulaStyle,
),
Text(
"YY",
style: YYStyle
),
Text(
" + floor(",
style: formulaStyle
),
Text(
"YY",
style: YYStyle
),
Text(
" / 4)) % 7",
style: formulaStyle
),
],
),
Spacer(),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text("1", style: pageNumCurrent),
Text(" - ", style: pageNum),
Text("2", style: pageNum),
],
)
],
)
),
Container(
padding: EdgeInsets.fromLTRB(0, 0, 0, 10),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
NumberPicker.integer(
initialValue: year,
minValue: 1700,
maxValue: 2399,
onChanged: (newYear) => this.setYearValues(newYear)
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text("For ", style: formulaStyle),
Text(centuriesString, style: formulaStyle),
Text(year.toString().substring(2), style: YYStyle),
Text(" our formula becomes: ", style: formulaStyle),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text("(", style: formulaStyle),
Text(yyString, style: YYStyle),
Text(" + floor(", style: formulaStyle),
Text(yyString, style: YYStyleU),
Text(" / 4", style: formulaStyleU),
Text(")) % 7", style: formulaStyle),
],
),
Text(glyph.unicodeGlyphs.downArrow, style: TextStyle(fontSize: 15)),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text("(", style: formulaStyle),
Text(yyString, style: YYStyle),
Text(" + ", style: formulaStyle),
Text("floor(" + yyDiv4.toString() + ")", style: formulaStyleU),
Text(") % 7", style: formulaStyle),
],
),
Text(glyph.unicodeGlyphs.downArrow, style: TextStyle(fontSize: 15)),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text("(", style: formulaStyleU),
Text(yyString, style: YYStyleU),
Text(" + " + yyDiv4Floored.toString() + ")", style: formulaStyleU),
Text(" % 7", style: formulaStyle),
],
),
Text(glyph.unicodeGlyphs.downArrow, style: TextStyle(fontSize: 15)),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text((yy + yyDiv4Floored).toString(), style: formulaStyleU),
Text(" % 7", style: formulaStyleU),
],
),
Text(glyph.unicodeGlyphs.downArrow, style: TextStyle(fontSize: 15)),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text("So the year value of " + year.toString() + " is: ", style: formulaStyle),
Text(yearValue.toString(), style: formulaStyleU),
],
),
Spacer(),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text("1", style: pageNum),
Text(" - ", style: pageNum),
Text("2", style: pageNumCurrent),
],
)
]
)
)
]
)
);
}
}

View file

@ -1,133 +0,0 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:ohthatsa/other/AppDrawer.dart';
import 'package:ohthatsa/main.dart';
import 'package:ohthatsa/pages/practice/thing/PracticeThing.dart';
import 'package:ohthatsa/pages/practice/thing/PracticeThingAll.dart';
import 'package:ohthatsa/pages/practice/thing/PracticeThingYear.dart';
import 'package:timezone/data/latest.dart' as tz;
import 'package:timezone/timezone.dart' as tz;
class NotificationsPage extends StatefulWidget {
@override
_NotificationPageState createState() => _NotificationPageState();
}
class _NotificationPageState extends State<NotificationsPage> {
@override
Widget build(BuildContext context){
return Scaffold(
drawer: AppDrawer(),
appBar: AppBar(
title: Text("Notifications")
),
body: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
FlatButton(
child: Text("Notify!"),
color: Colors.blue,
textColor: Colors.white,
onPressed: _notify
),
FlatButton(
child: Text("Schedule notification!"),
color: Colors.blue,
textColor: Colors.white,
onPressed: _scheduleNotify
),
FlatButton(
child: Text("Repeat!"),
color: Colors.blue,
textColor: Colors.white,
onPressed: _repeatNotification
),
FlatButton(
child: Text("Waiting?"),
color: Colors.blue,
textColor: Colors.white,
onPressed: _checkPendingNotificationRequests
),
FlatButton(
child: Text("Cancel"),
color: Colors.blue,
textColor: Colors.white,
onPressed: _cancelAllNotifications
),
],
)
);
}
Future<void> _notify() async {
const AndroidNotificationDetails androidPlatformChannelSpecifics =
AndroidNotificationDetails("test", "test", "test", ticker: 'ticker');
const NotificationDetails platformChannelSpecifics =
NotificationDetails(android: androidPlatformChannelSpecifics);
await flutterLocalNotificationsPlugin.show(
0,
'Title!',
'and the body...\nnewline;alskdjf;leowijhfraojnfoeiurhowieurhlaskbjdfowiuehrpwqiuehrwiejhraowlijehbrwaoliuh?',
platformChannelSpecifics,
payload: "test item?"
);
}
Future<void> _scheduleNotify() async {
PracticeThingAll pt = PracticeThingAll();
await flutterLocalNotificationsPlugin.zonedSchedule(
0,
pt.dateFormatter.format(pt.current),
pt.weekdayFormatter.format(pt.current),
tz.TZDateTime.now(tz.local).add(const Duration(seconds: 5)),
const NotificationDetails(
android: AndroidNotificationDetails("id", "name", "desc")
),
androidAllowWhileIdle: true,
uiLocalNotificationDateInterpretation: UILocalNotificationDateInterpretation.absoluteTime,
matchDateTimeComponents: DateTimeComponents.time
);
}
Future<void> _checkPendingNotificationRequests() async {
final List<PendingNotificationRequest> pendingNotificationRequests =
await flutterLocalNotificationsPlugin.pendingNotificationRequests();
return showDialog<void>(
context: context,
builder: (BuildContext context) => AlertDialog(
content:
Text('${pendingNotificationRequests.length} pending notification '
'requests'),
actions: <Widget>[
FlatButton(
onPressed: () {
Navigator.of(context).pop();
},
child: const Text('OK'),
),
],
),
);
}
Future<void> _repeatNotification() async {
const AndroidNotificationDetails androidPlatformChannelSpecifics =
AndroidNotificationDetails(
'id',
'name',
'desc'
);
const NotificationDetails platformChannelSpecifics =
NotificationDetails(android: androidPlatformChannelSpecifics);
await flutterLocalNotificationsPlugin.periodicallyShow(0, 'repeating title',
'repeating body', RepeatInterval.hourly, platformChannelSpecifics,
androidAllowWhileIdle: true);
}
Future<void> _cancelAllNotifications() async {
await flutterLocalNotificationsPlugin.cancelAll();
}
}

View file

@ -1,40 +0,0 @@
import 'package:flutter/material.dart';
import 'package:numberpicker/numberpicker.dart';
import 'package:ohthatsa/util/DayCalculator.dart';
import 'package:ohthatsa/other/AppDrawer.dart';
class YearsPage extends StatefulWidget {
@override
_YearsPageState createState() => _YearsPageState();
}
class _YearsPageState extends State<YearsPage> {
int _year = DateTime.now().year;
@override
Widget build(BuildContext context){
return Scaffold(
drawer: AppDrawer(),
appBar: AppBar(
title: Text("Years"),
),
body: Center(
child: Column(
children: <Widget>[
NumberPicker.integer(
initialValue: _year, // TODO set to current year
minValue: 1800,
maxValue: 2399,
onChanged: (newYear) =>
setState(() => _year = newYear),
),
Text("You picked the year: $_year"),
Text("The century code is: " + DayCalculator.getCenturyValue(_year).toString()),
Text("Is this a leap year: " + DayCalculator.isLeapYear(_year).toString()),
]
)
)
);
}
}