start adding login flow
This commit is contained in:
parent
c0c4c02815
commit
c76a8f3c28
14 changed files with 634 additions and 58 deletions
35
lib/widgets/appbar.dart
Normal file
35
lib/widgets/appbar.dart
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
import "dart:io";
|
||||
import "package:flutter/material.dart";
|
||||
|
||||
class Appbar extends StatelessWidget implements PreferredSizeWidget {
|
||||
final Widget? leading;
|
||||
final Widget? title;
|
||||
final Color? backgroundColor;
|
||||
final double? scrolledUnderElevation;
|
||||
final List<Widget> actions;
|
||||
const Appbar({
|
||||
super.key,
|
||||
this.title,
|
||||
this.backgroundColor,
|
||||
this.scrolledUnderElevation,
|
||||
this.leading,
|
||||
this.actions = const [],
|
||||
});
|
||||
|
||||
@override
|
||||
Size get preferredSize => AppBar().preferredSize;
|
||||
|
||||
@override
|
||||
AppBar build(BuildContext context) => AppBar(
|
||||
leading: leading,
|
||||
backgroundColor: backgroundColor,
|
||||
scrolledUnderElevation: scrolledUnderElevation,
|
||||
actionsPadding: EdgeInsets.symmetric(horizontal: 8),
|
||||
title: title,
|
||||
actions: [
|
||||
...actions,
|
||||
if (!(Platform.isAndroid || Platform.isIOS))
|
||||
IconButton(onPressed: () => exit(0), icon: Icon(Icons.close)),
|
||||
],
|
||||
);
|
||||
}
|
||||
29
lib/widgets/divider_text.dart
Normal file
29
lib/widgets/divider_text.dart
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import "package:flutter/material.dart";
|
||||
|
||||
class DividerText extends StatelessWidget {
|
||||
final String text;
|
||||
|
||||
const DividerText(this.text, {super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => LayoutBuilder(
|
||||
builder: (context, constraints) => Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 16,
|
||||
child: Divider(color: Theme.of(context).colorScheme.onSurface),
|
||||
),
|
||||
ConstrainedBox(
|
||||
constraints: BoxConstraints(maxWidth: constraints.maxWidth - 32),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: Text(text, style: Theme.of(context).textTheme.labelLarge),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Divider(color: Theme.of(context).colorScheme.onSurface),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
@ -1,8 +1,7 @@
|
|||
import "dart:io";
|
||||
|
||||
import "package:flutter/material.dart";
|
||||
import "package:nexus/helpers/extension_helper.dart";
|
||||
import "package:nexus/models/full_room.dart";
|
||||
import "package:nexus/widgets/appbar.dart";
|
||||
import "package:nexus/widgets/avatar_or_hash.dart";
|
||||
|
||||
class RoomAppbar extends StatelessWidget implements PreferredSizeWidget {
|
||||
|
|
@ -22,7 +21,7 @@ class RoomAppbar extends StatelessWidget implements PreferredSizeWidget {
|
|||
Size get preferredSize => AppBar().preferredSize;
|
||||
|
||||
@override
|
||||
AppBar build(BuildContext context) => AppBar(
|
||||
Widget build(BuildContext context) => Appbar(
|
||||
leading: isDesktop
|
||||
? AvatarOrHash(
|
||||
room.avatar,
|
||||
|
|
@ -33,7 +32,6 @@ class RoomAppbar extends StatelessWidget implements PreferredSizeWidget {
|
|||
)
|
||||
: DrawerButton(onPressed: () => onOpenDrawer(context)),
|
||||
scrolledUnderElevation: 0,
|
||||
actionsPadding: EdgeInsets.symmetric(horizontal: 8),
|
||||
title: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
|
|
@ -54,8 +52,6 @@ class RoomAppbar extends StatelessWidget implements PreferredSizeWidget {
|
|||
onPressed: () => onOpenMemberList(context),
|
||||
icon: Icon(Icons.people),
|
||||
),
|
||||
if (!(Platform.isAndroid || Platform.isIOS))
|
||||
IconButton(onPressed: () => exit(0), icon: Icon(Icons.close)),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue