@ -32,7 +32,8 @@ class HomeserverPickerView extends StatelessWidget {
) ,
) ,
) ,
) ,
/ / Pangea #
/ / Pangea #
body: ListView (
body: Column (
crossAxisAlignment: CrossAxisAlignment . stretch ,
children: [
children: [
/ / display a prominent banner to import session for TOR browser
/ / display a prominent banner to import session for TOR browser
/ / users . This feature is just some UX sugar as TOR users are
/ / users . This feature is just some UX sugar as TOR users are
@ -58,31 +59,29 @@ class HomeserverPickerView extends StatelessWidget {
/ / ) ,
/ / ) ,
/ / ) ,
/ / ) ,
/ / ) ,
/ / ) ,
/ / Image . asset (
/ / if ( MediaQuery . of ( context ) . size . height > 512 )
/ / ConstrainedBox (
/ / constraints: BoxConstraints (
/ / maxHeight: MediaQuery . of ( context ) . size . height / 4 ,
/ / ) ,
/ / child: Image . asset (
/ / ' assets/banner_transparent.png ' ,
/ / ' assets/banner_transparent.png ' ,
/ / alignment: Alignment . center ,
/ / repeat: ImageRepeat . repeat ,
/ / ) ,
/ / ) ,
/ / ) ,
/ / Pangea #
/ / Pangea #
Padding (
Padding (
padding: const EdgeInsets . only (
padding: const EdgeInsets . all ( 32.0 ) ,
top: 16.0 ,
right: 8.0 ,
left: 8.0 ,
bottom: 16.0 ,
) ,
child: Column (
crossAxisAlignment: CrossAxisAlignment . stretch ,
mainAxisSize: MainAxisSize . min ,
children: [
Padding (
padding: const EdgeInsets . all ( 16.0 ) ,
child: TextField (
child: TextField (
onChanged: controller . tryCheckHomeserverActionWithCooldown ,
onChanged: controller . tryCheckHomeserverActionWithCooldown ,
onEditingComplete:
onEditingComplete:
controller . tryCheckHomeserverActionWithoutCooldown ,
controller . tryCheckHomeserverActionWithoutCooldown ,
onSubmitted:
onSubmitted: controller . tryCheckHomeserverActionWithoutCooldown ,
controller . tryCheckHomeserverActionWithoutCooldown ,
onTap: controller . tryCheckHomeserverActionWithCooldown ,
onTap: controller . tryCheckHomeserverActionWithCooldown ,
controller: controller . homeserverController ,
controller: controller . homeserverController ,
autocorrect: false ,
keyboardType: TextInputType . url ,
decoration: InputDecoration (
decoration: InputDecoration (
prefixIcon: controller . isLoading
prefixIcon: controller . isLoading
? Container (
? Container (
@ -100,8 +99,7 @@ class HomeserverPickerView extends StatelessWidget {
: const Icon ( Icons . search_outlined ) ,
: const Icon ( Icons . search_outlined ) ,
filled: false ,
filled: false ,
border: OutlineInputBorder (
border: OutlineInputBorder (
borderRadius:
borderRadius: BorderRadius . circular ( AppConfig . borderRadius ) ,
BorderRadius . circular ( AppConfig . borderRadius ) ,
) ,
) ,
hintText: AppConfig . defaultHomeserver ,
hintText: AppConfig . defaultHomeserver ,
labelText: L10n . of ( context ) ! . homeserver ,
labelText: L10n . of ( context ) ! . homeserver ,
@ -137,29 +135,26 @@ class HomeserverPickerView extends StatelessWidget {
) ,
) ,
) ,
) ,
) ,
) ,
if ( controller . supportsPasswordLogin | | controller . supportsSso )
if ( MediaQuery . of ( context ) . size . height > 512 ) const Spacer ( ) ,
Padding (
ListView (
shrinkWrap: true ,
padding: const EdgeInsets . symmetric (
padding: const EdgeInsets . symmetric (
horizontal: 16 .0,
horizontal: 32 .0,
vertical: 8 .0,
vertical: 32 .0,
) ,
) ,
child: ElevatedButton (
children: [
style: ElevatedButton . styleFrom (
TextButton (
backgroundColor: theme . colorScheme . primary ,
style: TextButton . styleFrom (
foregroundColor: theme . colorScheme . onPrimary ,
textStyle: theme . textTheme . labelMedium ,
foregroundColor: theme . colorScheme . secondary ,
) ,
) ,
onPressed: controller . isLoggingIn | | controller . isLoading
onPressed: controller . isLoggingIn | | controller . isLoading
? null
? null
: controller . supportsSso
: controller . restoreBackup ,
? controller . ssoLoginAction
child: Text ( L10n . of ( context ) ! . hydrate ) ,
: controller . login ,
child: Text ( L10n . of ( context ) ! . connect ) ,
) ,
) ,
) ,
if ( controller . supportsPasswordLogin & & controller . supportsSso )
if ( controller . supportsPasswordLogin & & controller . supportsSso )
Padding (
TextButton (
padding: const EdgeInsets . symmetric ( horizontal: 16.0 ) ,
child: TextButton (
style: TextButton . styleFrom (
style: TextButton . styleFrom (
foregroundColor: theme . colorScheme . secondary ,
foregroundColor: theme . colorScheme . secondary ,
textStyle: theme . textTheme . labelMedium ,
textStyle: theme . textTheme . labelMedium ,
@ -169,23 +164,22 @@ class HomeserverPickerView extends StatelessWidget {
: controller . login ,
: controller . login ,
child: Text ( L10n . of ( context ) ! . loginWithMatrixId ) ,
child: Text ( L10n . of ( context ) ! . loginWithMatrixId ) ,
) ,
) ,
) ,
const SizedBox ( height: 8.0 ) ,
Padding (
if ( controller . supportsPasswordLogin | | controller . supportsSso )
padding: const EdgeInsets . symmetric ( horizontal: 16.0 ) ,
ElevatedButton (
child: TextButton (
style: ElevatedButton . styleFrom (
style: TextButton . styleFrom (
backgroundColor: theme . colorScheme . primary ,
textStyle: theme . textTheme . labelMedium ,
foregroundColor: theme . colorScheme . onPrimary ,
foregroundColor: theme . colorScheme . secondary ,
) ,
) ,
onPressed: controller . isLoggingIn | | controller . isLoading
onPressed: controller . isLoggingIn | | controller . isLoading
? null
? null
: controller . restoreBackup ,
: controller . supportsSso
child: Text ( L10n . of ( context ) ! . hydrate ) ,
? controller . ssoLoginAction
) ,
: controller . login ,
child: Text ( L10n . of ( context ) ! . next ) ,
) ,
) ,
] ,
] ,
) ,
) ,
) ,
] ,
] ,
) ,
) ,
) ;
) ;