Skip to content

Commit

Permalink
💾 Feat: Basic Plugins Page Framework
Browse files Browse the repository at this point in the history
  • Loading branch information
Dynesshely committed Oct 8, 2024
1 parent 0d30fd1 commit 31e9aa9
Show file tree
Hide file tree
Showing 7 changed files with 145 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import 'package:flutter/material.dart';
import 'package:kitx_website/shared/plugin_info.dart';

class PluginCard extends StatelessWidget {
const PluginCard({
required this.info,
});

final PluginInfo info;

@override
Widget build(BuildContext context) {
return Card.filled(
child: const SizedBox(
width: 200,
height: 300,
),
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import 'package:flutter/material.dart';
import 'package:kitx_website/pages/controls/plugin_card.dart';
import 'package:kitx_website/shared/plugin_info.dart';

class PluginItem extends StatelessWidget {
const PluginItem({
required this.info,
});

final PluginInfo info;

@override
Widget build(BuildContext context) {
var size = MediaQuery.of(context).size;
return size.width > size.height
? PluginCard(info: info)
: Padding(
padding: EdgeInsets.all(5),
child: ListTile(
title: Text(info.name),
subtitle: Text(info.author),
onTap: () {},
),
);
}
}
69 changes: 68 additions & 1 deletion KitX Website Flutter/kitx_website/lib/pages/plugins_page.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import 'package:community_material_icon/community_material_icon.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:kitx_website/pages/controls/plugin_item.dart';
import 'package:kitx_website/shared/plugin_info.dart';

class PluginsPage extends StatefulWidget {
const PluginsPage({super.key});
Expand All @@ -15,6 +19,69 @@ class _PluginsPageState extends State<PluginsPage> {

@override
Widget build(BuildContext context) {
return Center(child: Text('Under developing ...'));
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.symmetric(
horizontal: 20,
vertical: 15,
),
child: Row(
children: [
const Icon(
CommunityMaterialIcons.cube_outline,
size: 32,
),
Text(
' ${'Plugins_Title'.tr}',
style: const TextStyle(fontSize: 32),
),
],
),
),
const SizedBox(height: 10),
Row(
children: [
Padding(
padding: EdgeInsets.only(left: 20, right: 15),
child: SizedBox(
width: MediaQuery.of(context).size.width > 600 ? 400 : MediaQuery.of(context).size.width - 38.5,
child: TextField(
autofocus: true,
decoration: InputDecoration(
prefixIcon: const Icon(Icons.search),
border: OutlineInputBorder(),
labelText: 'Search plugins ...',
),
),
),
),
],
),
const SizedBox(height: 10),
Padding(
padding: EdgeInsets.all(15),
child: Wrap(
spacing: 10,
runSpacing: 10,
children: [
PluginItem(
info: PluginInfo(
name: 'Test Plugin',
version: 'v0.0.1',
author: 'Eaucooh',
authorLink: null,
publisher: 'Crequency',
publisherLink: null,
iconBase64: null,
lastUpdated: DateTime.now(),
),
)
],
),
)
],
);
}
}
28 changes: 28 additions & 0 deletions KitX Website Flutter/kitx_website/lib/shared/plugin_info.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
class PluginInfo {
const PluginInfo({
required this.name,
required this.version,
required this.author,
required this.authorLink,
required this.publisher,
required this.publisherLink,
required this.iconBase64,
required this.lastUpdated,
});

final String name;

final String version;

final String author;

final String? authorLink;

final String publisher;

final String? publisherLink;

final String? iconBase64;

final DateTime lastUpdated;
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ const Map<String, String> en_US = {
'MultiArchSupport': 'Support multi architectures',
'Get-on-F-Droid': 'Get on F-Droid',
'Get-on-F-Droid-Details': 'You can get this on F-Droid and keep updating',
'Plugins_Title': 'Download Plugins',
};
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ const Map<String, String> zh_CN = {
'MultiArchSupport': '包含多个架构支持',
'Get-on-F-Droid': '在 F-Droid 上获取',
'Get-on-F-Droid-Details': '您可以在 F-Droid 上获取并保持最新',
'Plugins_Title': '下载插件',
};
2 changes: 1 addition & 1 deletion KitX Website Flutter/kitx_website/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dependencies:
dev_dependencies:
build: ^2.4.1
build_runner: ^2.4.12
flutter_lints: ^4.0.0
flutter_lints: ^5.0.0
flutter_test:
sdk: flutter
flutter_web_optimizer: ^1.4.1
Expand Down

0 comments on commit 31e9aa9

Please sign in to comment.