Basic Functions done
This commit is contained in:
@@ -8,8 +8,37 @@ import 'package:charts_flutter/flutter.dart' as charts;
|
||||
import 'NewTask.dart';
|
||||
import 'newActivity.dart';
|
||||
import 'Tasks.dart';
|
||||
import 'Activities.dart';
|
||||
import 'User.dart' as User;
|
||||
import 'package:sn_progress_dialog/sn_progress_dialog.dart';
|
||||
|
||||
late ProgressDialog progressDialog;
|
||||
|
||||
showAlertDialog(BuildContext context, String title, String message) {
|
||||
|
||||
// set up the button
|
||||
Widget okButton = TextButton(
|
||||
child: Text("OK"),
|
||||
onPressed: () { Navigator.of(context).pop(); },
|
||||
);
|
||||
|
||||
// set up the AlertDialog
|
||||
AlertDialog alert = AlertDialog(
|
||||
title: Text(title),
|
||||
content: Text(message),
|
||||
actions: [
|
||||
okButton,
|
||||
],
|
||||
);
|
||||
|
||||
// show the dialog
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return alert;
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
extension HexColor on Color {
|
||||
/// String is in the format "aabbcc" or "ffaabbcc" with an optional leading "#".
|
||||
@@ -49,7 +78,7 @@ final List<PopulationData> data = [
|
||||
];
|
||||
|
||||
void main() {
|
||||
Wakelock.enable(); // or Wakelock.toggle(on: true);
|
||||
//Wakelock.enable(); // or Wakelock.toggle(on: true);
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
@@ -72,7 +101,8 @@ class MyApp extends StatelessWidget {
|
||||
'/welcome':(context)=> const WelcomePage(),
|
||||
'/':(context) => const MyHomePage(),
|
||||
'/Tasks':(context)=> const Tasks(),
|
||||
'/Categories':(context)=>const Categories()
|
||||
'/Categories':(context)=>const Categories(),
|
||||
'/Activities':(context)=>const Activities()
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -101,6 +131,8 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
super.initState();
|
||||
|
||||
showOfflineSnack();
|
||||
progressDialog = ProgressDialog(context: context);
|
||||
User.progressDialog=progressDialog;
|
||||
}
|
||||
|
||||
void showOfflineSnack() async{
|
||||
|
||||
Reference in New Issue
Block a user