-
Notifications
You must be signed in to change notification settings - Fork 0
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 #344 from verdigado/209-intro-screen
201: Implement login screen
- Loading branch information
Showing
20 changed files
with
360 additions
and
65 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion
2
lib/features/auth/bloc/auth_bloc.dart → lib/app/auth/bloc/auth_bloc.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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
lib/features/auth/bloc/auth_stream.dart → lib/app/auth/utils/auth_stream.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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:gruene_app/app/theme/theme.dart'; | ||
|
||
class BottomSheetHandle extends StatelessWidget { | ||
const BottomSheetHandle({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Center( | ||
child: Container( | ||
width: 48, | ||
height: 6, | ||
decoration: BoxDecoration( | ||
color: ThemeColors.textLight, | ||
borderRadius: BorderRadius.all(Radius.circular(18)), | ||
), | ||
), | ||
); | ||
} | ||
} |
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,83 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:gruene_app/app/widgets/bottom_sheet_handle.dart'; | ||
|
||
const double defaultBottomSheetSize = 0.2; | ||
|
||
class PersistentBottomSheet extends StatefulWidget { | ||
final Widget child; | ||
final double initialChildSize; | ||
final double minChildSize; | ||
final double maxChildSize; | ||
final List<double> snapSizes; | ||
|
||
const PersistentBottomSheet({ | ||
super.key, | ||
required this.child, | ||
this.initialChildSize = defaultBottomSheetSize, | ||
this.minChildSize = defaultBottomSheetSize, | ||
this.maxChildSize = 1, | ||
this.snapSizes = const [], | ||
}); | ||
|
||
@override | ||
State<PersistentBottomSheet> createState() => _PersistentBottomSheetState(); | ||
} | ||
|
||
class _PersistentBottomSheetState extends State<PersistentBottomSheet> { | ||
final _controller = DraggableScrollableController(); | ||
final _sheet = GlobalKey(); | ||
|
||
@override | ||
void dispose() { | ||
super.dispose(); | ||
_controller.dispose(); | ||
} | ||
|
||
DraggableScrollableSheet get sheet => (_sheet.currentWidget as DraggableScrollableSheet); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final theme = Theme.of(context); | ||
return Positioned( | ||
left: 0, | ||
right: 0, | ||
bottom: 0, | ||
top: 0, | ||
child: DraggableScrollableSheet( | ||
key: _sheet, | ||
initialChildSize: widget.initialChildSize, | ||
minChildSize: widget.minChildSize, | ||
maxChildSize: widget.maxChildSize, | ||
snapSizes: widget.snapSizes, | ||
controller: _controller, | ||
snap: true, | ||
expand: true, | ||
builder: (BuildContext context, ScrollController scrollController) { | ||
return Container( | ||
padding: EdgeInsets.symmetric(vertical: 24, horizontal: 16), | ||
decoration: BoxDecoration( | ||
color: theme.colorScheme.secondary, | ||
borderRadius: BorderRadius.vertical(top: Radius.circular(18)), | ||
), | ||
child: ListView( | ||
controller: scrollController, | ||
children: [ | ||
Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
mainAxisSize: MainAxisSize.max, | ||
children: [ | ||
BottomSheetHandle(), | ||
Container( | ||
padding: EdgeInsets.symmetric(vertical: 24, horizontal: 16), | ||
child: widget.child, | ||
), | ||
], | ||
), | ||
], | ||
), | ||
); | ||
}, | ||
), | ||
); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,36 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:gruene_app/app/widgets/persistent_bottom_sheet.dart'; | ||
import 'package:gruene_app/features/login/widgets/intro_slides.dart'; | ||
import 'package:gruene_app/features/login/widgets/support_button.dart'; | ||
import 'package:gruene_app/features/login/widgets/welcome_view.dart'; | ||
|
||
class LoginScreen extends StatelessWidget { | ||
const LoginScreen({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final theme = Theme.of(context); | ||
return Scaffold( | ||
appBar: AppBar(backgroundColor: theme.colorScheme.surface, toolbarHeight: 0), | ||
body: Container( | ||
color: theme.colorScheme.surface, | ||
child: Stack( | ||
children: [ | ||
LayoutBuilder( | ||
builder: (context, constraints) { | ||
return Container( | ||
padding: EdgeInsets.only(bottom: defaultBottomSheetSize * constraints.maxHeight), | ||
child: WelcomeView(), | ||
); | ||
}, | ||
), | ||
SupportButton(), | ||
PersistentBottomSheet( | ||
child: IntroSlides(), | ||
), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |
Oops, something went wrong.