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.

94 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.surface,
  14. foregroundColor: Theme.of(context).colorScheme.onSurface,
  15. minimumSize: const Size.fromHeight(50),
  16. padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 10),
  17. textStyle: const TextStyle(
  18. fontSize: 20,
  19. fontWeight: FontWeight.bold,
  20. ),
  21. );
  22. return WillPopScope(
  23. onWillPop: () async => false,
  24. child: Scaffold(
  25. body: SafeArea(
  26. child: Center(
  27. child: Column(
  28. mainAxisAlignment: MainAxisAlignment.center,
  29. crossAxisAlignment: CrossAxisAlignment.center,
  30. children: <Widget>[
  31. Center(
  32. child: Row(
  33. mainAxisAlignment: MainAxisAlignment.center,
  34. crossAxisAlignment: CrossAxisAlignment.center,
  35. children: [
  36. Image(
  37. image: AssetImage(
  38. MediaQuery.of(context).platformBrightness == Brightness.dark ?
  39. 'assets/logo_orange.png' :
  40. 'assets/logo_blue.png'
  41. ),
  42. height: 150,
  43. )
  44. ]
  45. ),
  46. ),
  47. const SizedBox(height: 30),
  48. Padding(
  49. padding: const EdgeInsets.only(
  50. top: 15,
  51. bottom: 15,
  52. left: 20,
  53. right: 20,
  54. ),
  55. child: Column (
  56. children: [
  57. ElevatedButton(
  58. child: const Text('Login'),
  59. onPressed: () => {
  60. Navigator.of(context).push(
  61. MaterialPageRoute(builder: (context) => const Login()),
  62. ),
  63. },
  64. style: buttonStyle,
  65. ),
  66. const SizedBox(height: 20),
  67. ElevatedButton(
  68. child: const Text('Sign Up'),
  69. onPressed: () => {
  70. Navigator.of(context).push(
  71. MaterialPageRoute(builder: (context) => const Signup()),
  72. ),
  73. },
  74. style: buttonStyle,
  75. ),
  76. const SizedBox(height: 50),
  77. ]
  78. ),
  79. ),
  80. ],
  81. ),
  82. ),
  83. ),
  84. ),
  85. );
  86. }
  87. }