-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #192 from guyluz11/dev
Dev
- Loading branch information
Showing
11 changed files
with
110 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class PopupMenuEntryAtom<T extends Enum> extends PopupMenuEntry<T> { | ||
const PopupMenuEntryAtom({ | ||
required this.value, | ||
required this.child, | ||
required this.onTap, | ||
}); | ||
|
||
final T value; | ||
final Widget child; | ||
final VoidCallback onTap; | ||
|
||
@override | ||
double get height => 50.0; | ||
|
||
@override | ||
bool represents(T? value) { | ||
return value != null && value == this.value; | ||
} | ||
|
||
@override | ||
State createState() => _CustomPopupMenuEntryState<T>(); | ||
} | ||
|
||
class _CustomPopupMenuEntryState<T extends Enum> | ||
extends State<PopupMenuEntryAtom<T>> { | ||
@override | ||
Widget build(BuildContext context) { | ||
return ListTile( | ||
title: widget.child, | ||
onTap: widget.onTap, | ||
); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
lib/presentation/molecules/back_to_home_alert_dialog_molecule.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:infinite_horizons/presentation/molecules/molecules.dart'; | ||
import 'package:infinite_horizons/presentation/pages/pages.dart'; | ||
|
||
void backToHomePopup(BuildContext context) { | ||
openAlertDialog( | ||
context, | ||
const SizedBox( | ||
height: 150, | ||
child: PageEnclosureMolecule( | ||
title: 'Exit Session', | ||
subTitle: 'Navigate back to Home Page?', | ||
expendChild: false, | ||
child: SizedBox(), | ||
), | ||
), | ||
onConfirm: () { | ||
Navigator.push( | ||
context, | ||
MaterialPageRoute( | ||
builder: (context) => HomePage(), | ||
), | ||
); | ||
}, | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters