Skip to content

Commit

Permalink
fix: desktop tab problem
Browse files Browse the repository at this point in the history
  • Loading branch information
mengyanshou committed Aug 9, 2022
1 parent 8a0d194 commit 6d01805
Show file tree
Hide file tree
Showing 9 changed files with 278 additions and 229 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 2.1.4
* 修复PC端最近文件显示两个图片标签的问题
* 修复PC端侧栏异常的问题
## 2.1.3
* 更改外部链接跳转方式

Expand Down
3 changes: 3 additions & 0 deletions lib/config/config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@ class Config {
static String package;

static String packageConst = 'packages/speed_share/';

// Log.e(const String.fromEnvironment('APP_CHANNEL'));
// Log.e(const String.fromEnvironment('OTHER_VAR'));
static String versionName = 'v2.1.3';
}
22 changes: 16 additions & 6 deletions lib/generated/intl/messages_es.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class MessageLookup extends MessageLookupByLibrary {
"aboutSpeedShare" : MessageLookupByLibrary.simpleMessage("Acerca de Speed Share"),
"apk" : MessageLookupByLibrary.simpleMessage("Apk"),
"autoDownload" : MessageLookupByLibrary.simpleMessage("Descarga automática"),
"chatWindow" : MessageLookupByLibrary.simpleMessage("Ventana de chat"),
"clipboardshare" : MessageLookupByLibrary.simpleMessage("Compartir portapapeles"),
"common" : MessageLookupByLibrary.simpleMessage("Común"),
"currenVersion" : MessageLookupByLibrary.simpleMessage("Versión actual"),
Expand All @@ -32,17 +33,26 @@ class MessageLookup extends MessageLookupByLibrary {
"directory" : MessageLookupByLibrary.simpleMessage("Directorio"),
"doc" : MessageLookupByLibrary.simpleMessage("Documento"),
"downlaodPath" : MessageLookupByLibrary.simpleMessage("Ruta de descarga"),
"downloadTip" : MessageLookupByLibrary.simpleMessage("SpeedShare también es compatible con Windows, macOS y Linux"),
"image" : MessageLookupByLibrary.simpleMessage("Imagen"),
"inputConnect" : MessageLookupByLibrary.simpleMessage("Ingresar conexión"),
"lang" : MessageLookupByLibrary.simpleMessage("Idioma"),
"log" : MessageLookupByLibrary.simpleMessage("Registro"),
"messageNote" : MessageLookupByLibrary.simpleMessage("Vibrar al recibir un mensaje"),
"music" : MessageLookupByLibrary.simpleMessage("Música"),
"noMessageTip" : MessageLookupByLibrary.simpleMessage("Actualmente no hay mensajes, haga clic para entrar en la lista de mensajes"),
"openSource" : MessageLookupByLibrary.simpleMessage("Código abierto"),
"otherVersion" : MessageLookupByLibrary.simpleMessage("Descargar la otra versión"),
"recentFile" : MessageLookupByLibrary.simpleMessage("Archivo reciente"),
"recentImg" : MessageLookupByLibrary.simpleMessage("Imagen reciente"),
"remoteAccessDes" : MessageLookupByLibrary.simpleMessage("Puede gestionar el archivo abriendo esta URL con el navegador."),
"remoteAccessFile" : MessageLookupByLibrary.simpleMessage("Acceso remoto al archivo local"),
"ui" : MessageLookupByLibrary.simpleMessage("Diseñador de IU"),
"otherVersion" : MessageLookupByLibrary.simpleMessage("Descargar otra versión"),
"privacyAgreement" : MessageLookupByLibrary.simpleMessage("Acuerdo de privacidad"),
"qrTips" : MessageLookupByLibrary.simpleMessage("Deslice hacia un lado para cambiar de IP"),
"recentFile" : MessageLookupByLibrary.simpleMessage("Archivos recientes"),
"recentImg" : MessageLookupByLibrary.simpleMessage("Imágenes recientes"),
"remoteAccessDes" : MessageLookupByLibrary.simpleMessage("Puede administrar los archivos locales abriendo esta IP en el navegador."),
"remoteAccessFile" : MessageLookupByLibrary.simpleMessage("Archivo local de acceso remoto"),
"scan" : MessageLookupByLibrary.simpleMessage("Escanear código QR"),
"setting" : MessageLookupByLibrary.simpleMessage("Ajustes"),
"theTermsOfService" : MessageLookupByLibrary.simpleMessage("Términos de servicio"),
"ui" : MessageLookupByLibrary.simpleMessage("Diseñador de interfaz"),
"unknownFile" : MessageLookupByLibrary.simpleMessage("Archivo desconocido"),
"video" : MessageLookupByLibrary.simpleMessage("Vídeo"),
"zip" : MessageLookupByLibrary.simpleMessage("Zip")
Expand Down
22 changes: 16 additions & 6 deletions lib/l10n/intl_es.arb
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
{
"common": "Común",
"setting": "Ajustes",
"downlaodPath": "Ruta de descarga",
"autoDownload": "Descarga automática",
"clipboardshare": "Compartir portapapeles",
"messageNote": "Vibrar al recibir un mensaje",
"aboutSpeedShare": "Acerca de Speed Share",
"currenVersion": "Versión actual",
"otherVersion": "Descargar la otra versión",
"otherVersion": "Descargar otra versión",
"downloadTip": "SpeedShare también es compatible con Windows, macOS y Linux",
"lang": "Idioma",
"chatWindow": "Ventana de chat",
"developer": "Desarrollador",
"openSource": "Código abierto",
"ui": "Diseñador de IU",
"recentFile": "Archivo reciente",
"recentImg": "Imagen reciente",
"noMessageTip": "Actualmente no hay mensajes, haga clic para entrar en la lista de mensajes",
"inputConnect": "Ingresar conexión",
"scan": "Escanear código QR",
"log": "Registro",
"theTermsOfService": "Términos de servicio",
"privacyAgreement": "Acuerdo de privacidad",
"qrTips": "Deslice hacia un lado para cambiar de IP",
"ui": "Diseñador de interfaz",
"recentFile": "Archivos recientes",
"recentImg": "Imágenes recientes",
"currentRoom": "Sala de chat",
"remoteAccessFile": "Acceso remoto al archivo local",
"remoteAccessDes": "Puede gestionar el archivo abriendo esta URL con el navegador.",
"remoteAccessFile": "Archivo local de acceso remoto",
"remoteAccessDes": "Puede administrar los archivos locales abriendo esta IP en el navegador.",
"directory": "Directorio",
"unknownFile": "Archivo desconocido",
"zip": "Zip",
Expand Down
189 changes: 106 additions & 83 deletions lib/modules/adapive_entry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,91 +46,13 @@ class _AdaptiveEntryPointState extends State<AdaptiveEntryPoint> {
Widget build(BuildContext context) {
if (ResponsiveWrapper.of(context).isDesktop) {
page ??= GetPlatform.isWeb ? 1 : 0;
return Scaffold(
body: SafeArea(
left: false,
child: Column(
children: [
Container(
height: 1.w,
color: Theme.of(context).primaryColor,
),
Expanded(
child: Row(
children: [
DesktopDrawer(
value: page,
onChange: (value) {
page = value;
setState(() {});
},
),
GetBuilder<DeviceController>(builder: (controller) {
if (GetPlatform.isWeb) {
return Expanded(
child: [
const SizedBox(),
Container(
color: Colors.white,
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 8.w),
child: const ShareChatV2(),
),
),
for (int i = 0;
i < controller.connectDevice.length;
i++)
Builder(
builder: (context) {
Uri uri = Uri.tryParse(
controller.connectDevice[i].url,
);
String addr = 'http://${uri.host}:20000';
return FileManager(
address: addr,
usePackage: true,
path: controller
.connectDevice[i].deviceType ==
desktop
? '/User'
: '/sdcard',
);
},
),
const SizedBox(),
const SizedBox(),
][page],
);
}
return Expanded(
child: [
HomePage(
onMessageWindowTap: () {
page = 1;
setState(() {});
},
),
Container(
color: Colors.white,
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 8.w),
child: const ShareChatV2(),
),
),
const FilePage(),
const SettingPage(),
][page],
);
}),
],
),
),
],
),
),
);
return buildDesktop(context);
}
page ??= 0;
return buildMobile();
}

Scaffold buildMobile() {
return Scaffold(
body: SafeArea(
child: Column(
Expand Down Expand Up @@ -174,4 +96,105 @@ class _AdaptiveEntryPointState extends State<AdaptiveEntryPoint> {
),
);
}

Scaffold buildDesktop(BuildContext context) {
return Scaffold(
body: SafeArea(
left: false,
child: Column(
children: [
Container(
height: 1.w,
color: Theme.of(context).primaryColor,
),
Expanded(
child: Row(
children: [
DesktopDrawer(
value: page,
onChange: (value) {
page = value;
setState(() {});
},
),
GetBuilder<DeviceController>(builder: (controller) {
if (GetPlatform.isWeb) {
return Expanded(
child: [
const SizedBox(),
Container(
color: Colors.white,
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 8.w),
child: const ShareChatV2(),
),
),
for (int i = 0;
i < controller.connectDevice.length;
i++)
Builder(
builder: (context) {
Uri uri = Uri.tryParse(
controller.connectDevice[i].url,
);
String addr = 'http://${uri.host}:20000';
return FileManager(
address: addr,
usePackage: true,
path:
controller.connectDevice[i].deviceType ==
desktop
? '/User'
: '/sdcard',
);
},
),
const SizedBox(),
const SizedBox(),
][page],
);
}
return Expanded(
child: [
HomePage(
onMessageWindowTap: () {
page = 1;
setState(() {});
},
),
Container(
color: Colors.white,
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 8.w),
child: const ShareChatV2(),
),
),
for (int i = 0;
i < controller.connectDevice.length;
i++)
Builder(
builder: (context) {
Uri uri = Uri.tryParse(
controller.connectDevice[i].url,
);
String addr = 'http://${uri.host}:20000';
return FileManager(
address: addr,
usePackage: true,
);
},
),
const FilePage(),
const SettingPage(),
][page],
);
}),
],
),
),
],
),
),
);
}
}
2 changes: 1 addition & 1 deletion lib/modules/file/file_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class _FilePageState extends State<FilePage> {
),
SizedBox(
width: width,
child: imgFile(context),
child: apkFile(context),
),
],
);
Expand Down
Loading

0 comments on commit 6d01805

Please sign in to comment.