mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-06-28 20:09:51 +00:00
Fixed some issues home ui
This commit is contained in:
parent
4a20272772
commit
9d59a5caac
3 changed files with 80 additions and 76 deletions
|
@ -149,7 +149,7 @@ class CombinedHomeChart extends StatelessWidget {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (width > 900) {
|
if (width > 700) {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
|
@ -213,7 +213,12 @@ class CombinedHomeChart extends StatelessWidget {
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
),
|
||||||
|
Divider(
|
||||||
|
thickness: 1,
|
||||||
|
color: Theme.of(context).colorScheme.onSurface.withOpacity(0.2),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 16)
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -208,7 +208,6 @@ class _HomeState extends State<Home> {
|
||||||
],
|
],
|
||||||
if (width > 700) Column(
|
if (width > 700) Column(
|
||||||
children: [
|
children: [
|
||||||
const SizedBox(height: 16),
|
|
||||||
Wrap(
|
Wrap(
|
||||||
alignment: WrapAlignment.center,
|
alignment: WrapAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
|
@ -259,68 +258,71 @@ class _HomeState extends State<Home> {
|
||||||
}
|
}
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: Stack(
|
body: SafeArea(
|
||||||
children: [
|
top: false,
|
||||||
NestedScrollView(
|
child: Stack(
|
||||||
controller: scrollController,
|
children: [
|
||||||
headerSliverBuilder: (context, innerBoxIsScrolled) => [
|
NestedScrollView(
|
||||||
SliverOverlapAbsorber(
|
controller: scrollController,
|
||||||
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
headerSliverBuilder: (context, innerBoxIsScrolled) => [
|
||||||
sliver: HomeAppBar(innerBoxScrolled: innerBoxIsScrolled,)
|
SliverOverlapAbsorber(
|
||||||
|
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
||||||
|
sliver: HomeAppBar(innerBoxScrolled: innerBoxIsScrolled,)
|
||||||
|
)
|
||||||
|
],
|
||||||
|
body: SafeArea(
|
||||||
|
top: false,
|
||||||
|
bottom: false,
|
||||||
|
child: Builder(
|
||||||
|
builder: (context) => RefreshIndicator(
|
||||||
|
color: Theme.of(context).colorScheme.primary,
|
||||||
|
onRefresh: () async {
|
||||||
|
final result = await getServerStatus(serversProvider.selectedServer!);
|
||||||
|
if (result['result'] == 'success') {
|
||||||
|
serversProvider.setServerStatusData(result['data']);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
appConfigProvider.addLog(result['log']);
|
||||||
|
showSnacbkar(
|
||||||
|
appConfigProvider: appConfigProvider,
|
||||||
|
label: AppLocalizations.of(context)!.serverStatusNotRefreshed,
|
||||||
|
color: Colors.red
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: CustomScrollView(
|
||||||
|
slivers: [
|
||||||
|
SliverOverlapInjector(
|
||||||
|
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
||||||
|
),
|
||||||
|
if (serversProvider.serverStatus.loadStatus == 0) SliverFillRemaining(
|
||||||
|
child: loading(),
|
||||||
|
),
|
||||||
|
if (serversProvider.serverStatus.loadStatus == 1) SliverList.list(
|
||||||
|
children: listItems()
|
||||||
|
),
|
||||||
|
if (serversProvider.serverStatus.loadStatus == 2) SliverFillRemaining(
|
||||||
|
child: loadError(),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
),
|
||||||
|
)
|
||||||
)
|
)
|
||||||
],
|
),
|
||||||
body: SafeArea(
|
AnimatedPositioned(
|
||||||
top: false,
|
duration: const Duration(milliseconds: 100),
|
||||||
bottom: false,
|
curve: Curves.easeInOut,
|
||||||
child: Builder(
|
bottom: isVisible == true ?
|
||||||
builder: (context) => RefreshIndicator(
|
appConfigProvider.showingSnackbar
|
||||||
color: Theme.of(context).colorScheme.primary,
|
? 70
|
||||||
onRefresh: () async {
|
: 20
|
||||||
final result = await getServerStatus(serversProvider.selectedServer!);
|
: -70,
|
||||||
if (result['result'] == 'success') {
|
right: 20,
|
||||||
serversProvider.setServerStatusData(result['data']);
|
child: const HomeFab()
|
||||||
}
|
),
|
||||||
else {
|
],
|
||||||
appConfigProvider.addLog(result['log']);
|
),
|
||||||
showSnacbkar(
|
|
||||||
appConfigProvider: appConfigProvider,
|
|
||||||
label: AppLocalizations.of(context)!.serverStatusNotRefreshed,
|
|
||||||
color: Colors.red
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
child: CustomScrollView(
|
|
||||||
slivers: [
|
|
||||||
SliverOverlapInjector(
|
|
||||||
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
|
||||||
),
|
|
||||||
if (serversProvider.serverStatus.loadStatus == 0) SliverFillRemaining(
|
|
||||||
child: loading(),
|
|
||||||
),
|
|
||||||
if (serversProvider.serverStatus.loadStatus == 1) SliverList.list(
|
|
||||||
children: listItems()
|
|
||||||
),
|
|
||||||
if (serversProvider.serverStatus.loadStatus == 2) SliverFillRemaining(
|
|
||||||
child: loadError(),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
),
|
|
||||||
)
|
|
||||||
)
|
|
||||||
),
|
|
||||||
AnimatedPositioned(
|
|
||||||
duration: const Duration(milliseconds: 100),
|
|
||||||
curve: Curves.easeInOut,
|
|
||||||
bottom: isVisible == true ?
|
|
||||||
appConfigProvider.showingSnackbar
|
|
||||||
? 70
|
|
||||||
: 20
|
|
||||||
: -70,
|
|
||||||
right: 20,
|
|
||||||
child: const HomeFab()
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,22 +21,19 @@ class ServerStatus extends StatelessWidget {
|
||||||
padding: const EdgeInsets.only(left: 16, right: 16, bottom: 16),
|
padding: const EdgeInsets.only(left: 16, right: 16, bottom: 16),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Text(
|
||||||
padding: width > 700
|
AppLocalizations.of(context)!.serverStatus,
|
||||||
? const EdgeInsets.all(16)
|
style: TextStyle(
|
||||||
: const EdgeInsets.all(0),
|
fontSize: 18,
|
||||||
child: Text(
|
fontWeight: FontWeight.w500,
|
||||||
AppLocalizations.of(context)!.serverStatus,
|
color: Theme.of(context).colorScheme.onSurface
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 18,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
color: Theme.of(context).colorScheme.onSurface
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
const SizedBox(height: 16),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: width > 700 ? 70 : 170,
|
height: width > 700 ? 66 : 146,
|
||||||
child: GridView(
|
child: GridView(
|
||||||
|
padding: const EdgeInsets.all(0),
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
crossAxisCount: width > 700 ? 4 : 2,
|
crossAxisCount: width > 700 ? 4 : 2,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue