Skip to content
This repository has been archived by the owner on Jun 28, 2023. It is now read-only.

Commit

Permalink
更新函式庫:split_view
Browse files Browse the repository at this point in the history
  • Loading branch information
SiongSng committed Sep 16, 2021
1 parent 3ebb1c5 commit 7efbe8d
Show file tree
Hide file tree
Showing 7 changed files with 635 additions and 624 deletions.
182 changes: 92 additions & 90 deletions lib/Screen/Edit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1040,103 +1040,105 @@ class EditInstance_ extends State<EditInstance> {
child: Focus(
autofocus: true,
child: SplitView(
view1: ListView(
children: [
ListTile(
title: Text(i18n.Format("homepage")),
leading: Icon(
Icons.home_outlined,
children: [
ListView(
children: [
ListTile(
title: Text(i18n.Format("homepage")),
leading: Icon(
Icons.home_outlined,
),
onTap: () {
selectedIndex = 0;
setState(() {});
},
tileColor: selectedIndex == 0
? Colors.white12
: Theme.of(context).scaffoldBackgroundColor,
),
onTap: () {
selectedIndex = 0;
setState(() {});
},
tileColor: selectedIndex == 0
? Colors.white12
: Theme.of(context).scaffoldBackgroundColor,
),
ListTile(
title: Text(i18n.Format("edit.instance.mods.title")),
leading: Icon(
Icons.add_box_outlined,
ListTile(
title: Text(i18n.Format("edit.instance.mods.title")),
leading: Icon(
Icons.add_box_outlined,
),
onTap: () {
selectedIndex = 1;
setState(() {});
},
tileColor: selectedIndex == 1
? Colors.white12
: Theme.of(context).scaffoldBackgroundColor,
),
onTap: () {
selectedIndex = 1;
setState(() {});
},
tileColor: selectedIndex == 1
? Colors.white12
: Theme.of(context).scaffoldBackgroundColor,
),
ListTile(
title: Text(i18n.Format("edit.instance.world.title")),
leading: Icon(
Icons.public_outlined,
ListTile(
title: Text(i18n.Format("edit.instance.world.title")),
leading: Icon(
Icons.public_outlined,
),
onTap: () {
selectedIndex = 2;
setState(() {});
},
tileColor: selectedIndex == 2
? Colors.white12
: Theme.of(context).scaffoldBackgroundColor,
),
onTap: () {
selectedIndex = 2;
setState(() {});
},
tileColor: selectedIndex == 2
? Colors.white12
: Theme.of(context).scaffoldBackgroundColor,
),
ListTile(
title:
Text(i18n.Format("edit.instance.screenshot.title")),
leading: Icon(
Icons.screenshot_outlined,
ListTile(
title: Text(
i18n.Format("edit.instance.screenshot.title")),
leading: Icon(
Icons.screenshot_outlined,
),
onTap: () {
selectedIndex = 3;
setState(() {});
},
tileColor: selectedIndex == 3
? Colors.white12
: Theme.of(context).scaffoldBackgroundColor,
),
onTap: () {
selectedIndex = 3;
setState(() {});
},
tileColor: selectedIndex == 3
? Colors.white12
: Theme.of(context).scaffoldBackgroundColor,
),
ListTile(
title: Text("光影"),
leading: Icon(
Icons.hd,
ListTile(
title: Text("光影"),
leading: Icon(
Icons.hd,
),
onTap: () {
selectedIndex = 4;
setState(() {});
},
tileColor: selectedIndex == 4
? Colors.white12
: Theme.of(context).scaffoldBackgroundColor,
),
onTap: () {
selectedIndex = 4;
setState(() {});
},
tileColor: selectedIndex == 4
? Colors.white12
: Theme.of(context).scaffoldBackgroundColor,
),
ListTile(
title: Text("資源包"),
leading: Icon(LineIcons.penSquare),
onTap: () {
selectedIndex = 5;
setState(() {});
},
tileColor: selectedIndex == 5
? Colors.white12
: Theme.of(context).scaffoldBackgroundColor,
),
ListTile(
title: Text("安裝檔獨立設定"),
leading: Icon(
Icons.settings,
ListTile(
title: Text("資源包"),
leading: Icon(LineIcons.penSquare),
onTap: () {
selectedIndex = 5;
setState(() {});
},
tileColor: selectedIndex == 5
? Colors.white12
: Theme.of(context).scaffoldBackgroundColor,
),
onTap: () {
selectedIndex = 6;
setState(() {});
},
tileColor: selectedIndex == 6
? Colors.white12
: Theme.of(context).scaffoldBackgroundColor,
),
],
),
view2: WidgetList[selectedIndex],
ListTile(
title: Text("安裝檔獨立設定"),
leading: Icon(
Icons.settings,
),
onTap: () {
selectedIndex = 6;
setState(() {});
},
tileColor: selectedIndex == 6
? Colors.white12
: Theme.of(context).scaffoldBackgroundColor,
),
],
),
WidgetList[selectedIndex]
],
gripSize: 3,
initialWeight: 0.2,
controller: SplitViewController(weights: [0.2]),
viewMode: SplitViewMode.Horizontal),
),
),
Expand Down
118 changes: 60 additions & 58 deletions lib/Screen/Settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,8 @@ class SettingScreen_ extends State<SettingScreen> {
onChanged: (dynamic Channel) async {
setState(() {
UpdateChannel = Channel;
Config.Change(
'update_channel', Updater.toStringFromVersionType(Channel));
Config.Change('update_channel',
Updater.toStringFromVersionType(Channel));
});
}),
),
Expand Down Expand Up @@ -491,67 +491,69 @@ class SettingScreen_ extends State<SettingScreen> {
),
),
body: SplitView(
view1: ListView(
children: [
ListTile(
title: Text(
i18n.Format("settings.java.title"),
),
leading: Icon(
Icons.code_outlined,
children: [
ListView(
children: [
ListTile(
title: Text(
i18n.Format("settings.java.title"),
),
leading: Icon(
Icons.code_outlined,
),
onTap: () {
selectedIndex = 0;
setState(() {});
},
tileColor: selectedIndex == 0
? Colors.white12
: Theme.of(context).scaffoldBackgroundColor,
),
onTap: () {
selectedIndex = 0;
setState(() {});
},
tileColor: selectedIndex == 0
? Colors.white12
: Theme.of(context).scaffoldBackgroundColor,
),
ListTile(
title: Text(i18n.Format("settings.appearance.title")),
leading: Icon(
Icons.web_asset_outlined,
ListTile(
title: Text(i18n.Format("settings.appearance.title")),
leading: Icon(
Icons.web_asset_outlined,
),
onTap: () {
selectedIndex = 1;
setState(() {});
},
tileColor: selectedIndex == 1
? Colors.white12
: Theme.of(context).scaffoldBackgroundColor,
),
onTap: () {
selectedIndex = 1;
setState(() {});
},
tileColor: selectedIndex == 1
? Colors.white12
: Theme.of(context).scaffoldBackgroundColor,
),
ListTile(
title: Text(i18n.Format("settings.advanced.title")),
leading: Icon(
Icons.settings,
ListTile(
title: Text(i18n.Format("settings.advanced.title")),
leading: Icon(
Icons.settings,
),
onTap: () {
selectedIndex = 2;
setState(() {});
},
tileColor: selectedIndex == 2
? Colors.white12
: Theme.of(context).scaffoldBackgroundColor,
),
onTap: () {
selectedIndex = 2;
setState(() {});
},
tileColor: selectedIndex == 2
? Colors.white12
: Theme.of(context).scaffoldBackgroundColor,
),
ListTile(
title: Text("除錯選項"),
leading: Icon(
Icons.bug_report,
ListTile(
title: Text("除錯選項"),
leading: Icon(
Icons.bug_report,
),
onTap: () {
selectedIndex = 3;
setState(() {});
},
tileColor: selectedIndex == 3
? Colors.white12
: Theme.of(context).scaffoldBackgroundColor,
),
onTap: () {
selectedIndex = 3;
setState(() {});
},
tileColor: selectedIndex == 3
? Colors.white12
: Theme.of(context).scaffoldBackgroundColor,
),
],
),
view2: WidgetList[selectedIndex],
],
),
WidgetList[selectedIndex]
],
gripSize: 3,
initialWeight: 0.2,
controller: SplitViewController(weights: [0.2]),
viewMode: SplitViewMode.Horizontal),
);
}
Expand Down
Loading

0 comments on commit 7efbe8d

Please sign in to comment.