@ -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,133 +59,126 @@ class HomeserverPickerView extends StatelessWidget {
/ / ) ,
/ / ) ,
/ / ) ,
/ / ) ,
/ / ) ,
/ / ) ,
/ / Image . asset (
/ / if ( MediaQuery . of ( context ) . size . height > 512 )
/ / ' assets/banner_transparent.png ' ,
/ / ConstrainedBox (
/ / ) ,
/ / constraints: BoxConstraints (
/ / maxHeight: MediaQuery . of ( context ) . size . height / 4 ,
/ / ) ,
/ / child: Image . asset (
/ / ' 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 ,
child: TextField (
right: 8.0 ,
onChanged: controller . tryCheckHomeserverActionWithCooldown ,
left: 8.0 ,
onEditingComplete:
bottom: 16.0 ,
controller . tryCheckHomeserverActionWithoutCooldown ,
) ,
onSubmitted: controller . tryCheckHomeserverActionWithoutCooldown ,
child: Column (
onTap: controller . tryCheckHomeserverActionWithCooldown ,
crossAxisAlignment: CrossAxisAlignment . stretch ,
controller: controller . homeserverController ,
mainAxisSize: MainAxisSize . min ,
autocorrect: false ,
children: [
keyboardType: TextInputType . url ,
Padding (
decoration: InputDecoration (
padding: const EdgeInsets . all ( 16.0 ) ,
prefixIcon: controller . isLoading
child: TextField (
? Container (
onChanged: controller . tryCheckHomeserverActionWithCooldown ,
width: 16 ,
onEditingComplete:
height: 16 ,
controller . tryCheckHomeserverActionWithoutCooldown ,
alignment: Alignment . center ,
onSubmitted:
child: const SizedBox (
controller . tryCheckHomeserverActionWithoutCooldown ,
width: 16 ,
onTap: controller . tryCheckHomeserverActionWithCooldown ,
height: 16 ,
controller: controller . homeserverController ,
child: CircularProgressIndicator . adaptive (
decoration: InputDecoration (
strokeWidth: 2 ,
prefixIcon: controller . isLoading
) ,
? Container (
) ,
width: 16 ,
)
height: 16 ,
: const Icon ( Icons . search_outlined ) ,
alignment: Alignment . center ,
filled: false ,
child: const SizedBox (
border: OutlineInputBorder (
width: 16 ,
borderRadius: BorderRadius . circular ( AppConfig . borderRadius ) ,
height: 16 ,
) ,
child: CircularProgressIndicator . adaptive (
hintText: AppConfig . defaultHomeserver ,
strokeWidth: 2 ,
labelText: L10n . of ( context ) ! . homeserver ,
) ,
errorText: controller . error ,
) ,
suffixIcon: IconButton (
)
onPressed: ( ) {
: const Icon ( Icons . search_outlined ) ,
showDialog (
filled: false ,
context: context ,
border: OutlineInputBorder (
builder: ( context ) = > AlertDialog . adaptive (
borderRadius:
title: Text ( L10n . of ( context ) ! . whatIsAHomeserver ) ,
BorderRadius . circular ( AppConfig . borderRadius ) ,
content: Linkify (
) ,
text: L10n . of ( context ) ! . homeserverDescription ,
hintText: AppConfig . defaultHomeserver ,
) ,
labelText: L10n . of ( context ) ! . homeserver ,
actions: [
errorText: controller . error ,
TextButton (
suffixIcon: IconButton (
onPressed: ( ) = > launchUrl (
onPressed: ( ) {
Uri . https ( ' servers.joinmatrix.org ' ) ,
showDialog (
context: context ,
builder: ( context ) = > AlertDialog . adaptive (
title: Text ( L10n . of ( context ) ! . whatIsAHomeserver ) ,
content: Linkify (
text: L10n . of ( context ) ! . homeserverDescription ,
) ,
actions: [
TextButton (
onPressed: ( ) = > launchUrl (
Uri . https ( ' servers.joinmatrix.org ' ) ,
) ,
child: Text (
L10n . of ( context ) ! . discoverHomeservers ,
) ,
) ,
TextButton (
onPressed: Navigator . of ( context ) . pop ,
child: Text ( L10n . of ( context ) ! . close ) ,
) ,
] ,
) ,
) ,
) ;
child: Text (
} ,
L10n . of ( context ) ! . discoverHomeservers ,
icon: const Icon ( Icons . info_outlined ) ,
) ,
) ,
TextButton (
onPressed: Navigator . of ( context ) . pop ,
child: Text ( L10n . of ( context ) ! . close ) ,
) ,
] ,
) ,
) ,
) ,
) ;
} ,
icon: const Icon ( Icons . info_outlined ) ,
) ,
) ,
) ,
) ,
if ( MediaQuery . of ( context ) . size . height > 512 ) const Spacer ( ) ,
ListView (
shrinkWrap: true ,
padding: const EdgeInsets . symmetric (
horizontal: 32.0 ,
vertical: 32.0 ,
) ,
children: [
TextButton (
style: TextButton . styleFrom (
textStyle: theme . textTheme . labelMedium ,
foregroundColor: theme . colorScheme . secondary ,
) ,
onPressed: controller . isLoggingIn | | controller . isLoading
? null
: controller . restoreBackup ,
child: Text ( L10n . of ( context ) ! . hydrate ) ,
) ,
if ( controller . supportsPasswordLogin & & controller . supportsSso )
TextButton (
style: TextButton . styleFrom (
foregroundColor: theme . colorScheme . secondary ,
textStyle: theme . textTheme . labelMedium ,
) ,
) ,
onPressed: controller . isLoggingIn | | controller . isLoading
? null
: controller . login ,
child: Text ( L10n . of ( context ) ! . loginWithMatrixId ) ,
) ,
) ,
if ( controller . supportsPasswordLogin | | controller . supportsSso )
const SizedBox ( height: 8.0 ) ,
Padding (
if ( controller . supportsPasswordLogin | | controller . supportsSso )
padding: const EdgeInsets . symmetric (
ElevatedButton (
horizontal: 16.0 ,
style: ElevatedButton . styleFrom (
vertical: 8.0 ,
backgroundColor: theme . colorScheme . primary ,
) ,
foregroundColor: theme . colorScheme . onPrimary ,
child: ElevatedButton (
style: ElevatedButton . styleFrom (
backgroundColor: theme . colorScheme . primary ,
foregroundColor: theme . colorScheme . onPrimary ,
) ,
onPressed: controller . isLoggingIn | | controller . isLoading
? null
: controller . supportsSso
? controller . ssoLoginAction
: controller . login ,
child: Text ( L10n . of ( context ) ! . connect ) ,
) ,
) ,
) ,
if ( controller . supportsPasswordLogin & & controller . supportsSso )
onPressed: controller . isLoggingIn | | controller . isLoading
Padding (
? null
padding: const EdgeInsets . symmetric ( horizontal: 16.0 ) ,
: controller . supportsSso
child: TextButton (
? controller . ssoLoginAction
style: TextButton . styleFrom (
foregroundColor: theme . colorScheme . secondary ,
textStyle: theme . textTheme . labelMedium ,
) ,
onPressed: controller . isLoggingIn | | controller . isLoading
? null
: controller . login ,
: controller . login ,
child: Text ( L10n . of ( context ) ! . loginWithMatrixId ) ,
child: Text ( L10n . of ( context ) ! . next ) ,
) ,
) ,
Padding (
padding: const EdgeInsets . symmetric ( horizontal: 16.0 ) ,
child: TextButton (
style: TextButton . styleFrom (
textStyle: theme . textTheme . labelMedium ,
foregroundColor: theme . colorScheme . secondary ,
) ,
onPressed: controller . isLoggingIn | | controller . isLoading
? null
: controller . restoreBackup ,
child: Text ( L10n . of ( context ) ! . hydrate ) ,
) ,
) ,
) ,
] ,
] ,
) ,
) ,
) ,
] ,
] ,
) ,
) ,