mirror of
https://github.com/wgh136/pixes.git
synced 2025-09-27 12:57:24 +00:00
account settings
This commit is contained in:
@@ -7,9 +7,11 @@ void showToast(BuildContext context, {required String message, IconData? icon})
|
||||
var newEntry = OverlayEntry(
|
||||
builder: (context) => ToastOverlay(message: message, icon: icon));
|
||||
|
||||
OverlayWidget.of(context)?.addOverlay(newEntry);
|
||||
var overlay = OverlayWidget.of(context);
|
||||
|
||||
Timer(const Duration(seconds: 2), () => OverlayWidget.of(context)?.remove(newEntry));
|
||||
overlay?.addOverlay(newEntry);
|
||||
|
||||
Timer(const Duration(seconds: 2), () => overlay?.remove(newEntry));
|
||||
}
|
||||
|
||||
class ToastOverlay extends StatelessWidget {
|
||||
|
@@ -23,3 +23,29 @@ class TitleBar extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class SliverTitleBar extends StatelessWidget {
|
||||
const SliverTitleBar({required this.title, this.action, super.key});
|
||||
|
||||
final String title;
|
||||
|
||||
final Widget? action;
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SliverToBoxAdapter(
|
||||
child: SizedBox(
|
||||
child: Row(
|
||||
children: [
|
||||
Text(title,
|
||||
style: const TextStyle(fontSize: 20, fontWeight: FontWeight.bold),),
|
||||
const Spacer(),
|
||||
if(action != null)
|
||||
action!
|
||||
],
|
||||
).paddingHorizontal(16).paddingVertical(8),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user