Encrypted messaging app
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
3.2 KiB

  1. import 'package:flutter/material.dart';
  2. import './login.dart';
  3. import './signup.dart';
  4. class UnauthenticatedLandingWidget extends StatefulWidget {
  5. const UnauthenticatedLandingWidget({Key? key}) : super(key: key);
  6. @override
  7. State<UnauthenticatedLandingWidget> createState() => _UnauthenticatedLandingWidgetState();
  8. }
  9. class _UnauthenticatedLandingWidgetState extends State<UnauthenticatedLandingWidget> {
  10. @override
  11. Widget build(BuildContext context) {
  12. final ButtonStyle buttonStyle = ElevatedButton.styleFrom(
  13. backgroundColor: Theme.of(context).colorScheme.tertiary,
  14. minimumSize: const Size.fromHeight(50),
  15. padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 10),
  16. textStyle: const TextStyle(
  17. fontSize: 20,
  18. fontWeight: FontWeight.bold,
  19. ),
  20. );
  21. return WillPopScope(
  22. onWillPop: () async => false,
  23. child: Scaffold(
  24. body: SafeArea(
  25. child: Center(
  26. child: Column(
  27. mainAxisAlignment: MainAxisAlignment.center,
  28. crossAxisAlignment: CrossAxisAlignment.center,
  29. children: <Widget>[
  30. Center(
  31. child: Row(
  32. mainAxisAlignment: MainAxisAlignment.center,
  33. crossAxisAlignment: CrossAxisAlignment.center,
  34. children: [
  35. Image(
  36. image: AssetImage(
  37. MediaQuery.of(context).platformBrightness == Brightness.dark ?
  38. 'assets/logo_orange.png' :
  39. 'assets/logo_blue.png'
  40. ),
  41. height: 150,
  42. )
  43. ]
  44. ),
  45. ),
  46. const SizedBox(height: 30),
  47. Padding(
  48. padding: const EdgeInsets.only(
  49. top: 15,
  50. bottom: 15,
  51. left: 20,
  52. right: 20,
  53. ),
  54. child: Column (
  55. children: [
  56. ElevatedButton(
  57. onPressed: () => {
  58. Navigator.of(context).push(
  59. MaterialPageRoute(builder: (context) => const Login()),
  60. ),
  61. },
  62. style: buttonStyle,
  63. child: const Text('Login'),
  64. ),
  65. const SizedBox(height: 20),
  66. ElevatedButton(
  67. onPressed: () => {
  68. Navigator.of(context).push(
  69. MaterialPageRoute(builder: (context) => const Signup()),
  70. ),
  71. },
  72. style: buttonStyle,
  73. child: const Text('Sign Up'),
  74. ),
  75. const SizedBox(height: 50),
  76. ]
  77. ),
  78. ),
  79. ],
  80. ),
  81. ),
  82. ),
  83. ),
  84. );
  85. }
  86. }