mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-05-02 06:44:25 +02:00
feat: CustomScrollView in app and patches selector views (#208)
This commit is contained in:
parent
9bdccb3c9d
commit
2b7287c04c
@ -66,11 +66,13 @@
|
|||||||
"widgetSubtitle": "We are online!"
|
"widgetSubtitle": "We are online!"
|
||||||
},
|
},
|
||||||
"appSelectorView": {
|
"appSelectorView": {
|
||||||
|
"viewTitle": "Select application",
|
||||||
"searchBarHint": "Search applications",
|
"searchBarHint": "Search applications",
|
||||||
"storageButton": "Storage",
|
"storageButton": "Storage",
|
||||||
"errorMessage": "Unable to use selected application."
|
"errorMessage": "Unable to use selected application."
|
||||||
},
|
},
|
||||||
"patchesSelectorView": {
|
"patchesSelectorView": {
|
||||||
|
"viewTitle": "Select patches",
|
||||||
"searchBarHint": "Search patches",
|
"searchBarHint": "Search patches",
|
||||||
"doneButton": "Done",
|
"doneButton": "Done",
|
||||||
"noPatchesFound": "No patches found for the selected app."
|
"noPatchesFound": "No patches found for the selected app."
|
||||||
|
@ -31,13 +31,19 @@ class _AppSelectorViewState extends State<AppSelectorView> {
|
|||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
body: SafeArea(
|
body: CustomScrollView(
|
||||||
|
slivers: [
|
||||||
|
SliverAppBar(
|
||||||
|
pinned: true,
|
||||||
|
floating: true,
|
||||||
|
snap: false,
|
||||||
|
title: I18nText('appSelectorView.viewTitle'),
|
||||||
|
bottom: PreferredSize(
|
||||||
|
preferredSize: const Size.fromHeight(64.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding:
|
padding: const EdgeInsets.symmetric(
|
||||||
const EdgeInsets.symmetric(vertical: 4.0, horizontal: 12.0),
|
vertical: 8.0, horizontal: 12.0),
|
||||||
child: Column(
|
child: SearchBar(
|
||||||
children: <Widget>[
|
|
||||||
SearchBar(
|
|
||||||
showSelectIcon: false,
|
showSelectIcon: false,
|
||||||
hintText: FlutterI18n.translate(
|
hintText: FlutterI18n.translate(
|
||||||
context,
|
context,
|
||||||
@ -49,16 +55,20 @@ class _AppSelectorViewState extends State<AppSelectorView> {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
const SizedBox(height: 12),
|
),
|
||||||
Expanded(
|
),
|
||||||
|
),
|
||||||
|
SliverToBoxAdapter(
|
||||||
child: model.noApps
|
child: model.noApps
|
||||||
? Center(
|
? Center(
|
||||||
child: I18nText('appSelectorCard.noAppsLabel'),
|
child: I18nText('appSelectorCard.noAppsLabel'),
|
||||||
)
|
)
|
||||||
: model.apps.isEmpty
|
: model.apps.isEmpty
|
||||||
? const AppSkeletonLoader()
|
? const AppSkeletonLoader()
|
||||||
: ListView(
|
: Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 80),
|
padding: const EdgeInsets.only(bottom: 80).add(
|
||||||
|
const EdgeInsets.symmetric(horizontal: 12.0)),
|
||||||
|
child: Column(
|
||||||
children: model
|
children: model
|
||||||
.getFilteredApps(_query)
|
.getFilteredApps(_query)
|
||||||
.map((app) => InkWell(
|
.map((app) => InkWell(
|
||||||
@ -75,11 +85,10 @@ class _AppSelectorViewState extends State<AppSelectorView> {
|
|||||||
.toList(),
|
.toList(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,13 +33,19 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
body: SafeArea(
|
body: CustomScrollView(
|
||||||
|
slivers: [
|
||||||
|
SliverAppBar(
|
||||||
|
pinned: true,
|
||||||
|
floating: true,
|
||||||
|
snap: false,
|
||||||
|
title: I18nText('patchesSelectorView.viewTitle'),
|
||||||
|
bottom: PreferredSize(
|
||||||
|
preferredSize: const Size.fromHeight(64.0),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding:
|
padding: const EdgeInsets.symmetric(
|
||||||
const EdgeInsets.symmetric(vertical: 4.0, horizontal: 12.0),
|
vertical: 8.0, horizontal: 12.0),
|
||||||
child: Column(
|
child: SearchBar(
|
||||||
children: <Widget>[
|
|
||||||
SearchBar(
|
|
||||||
showSelectIcon: true,
|
showSelectIcon: true,
|
||||||
hintText: FlutterI18n.translate(
|
hintText: FlutterI18n.translate(
|
||||||
context,
|
context,
|
||||||
@ -52,8 +58,10 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
|
|||||||
},
|
},
|
||||||
onSelectAll: (value) => model.selectAllPatches(value),
|
onSelectAll: (value) => model.selectAllPatches(value),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 12),
|
),
|
||||||
Expanded(
|
),
|
||||||
|
),
|
||||||
|
SliverToBoxAdapter(
|
||||||
child: model.patches.isEmpty
|
child: model.patches.isEmpty
|
||||||
? Padding(
|
? Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
@ -67,8 +75,10 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
: ListView(
|
: Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 80),
|
padding: const EdgeInsets.only(bottom: 80)
|
||||||
|
.add(const EdgeInsets.symmetric(horizontal: 12.0)),
|
||||||
|
child: Column(
|
||||||
children: model
|
children: model
|
||||||
.getQueriedPatches(_query)
|
.getQueriedPatches(_query)
|
||||||
.map(
|
.map(
|
||||||
@ -168,11 +178,10 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
|
|||||||
.toList(),
|
.toList(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@ class AppSkeletonLoader extends StatelessWidget {
|
|||||||
return Skeleton(
|
return Skeleton(
|
||||||
isLoading: true,
|
isLoading: true,
|
||||||
skeleton: ListView.builder(
|
skeleton: ListView.builder(
|
||||||
|
shrinkWrap: true,
|
||||||
itemCount: 7,
|
itemCount: 7,
|
||||||
itemBuilder: (context, index) => Padding(
|
itemBuilder: (context, index) => Padding(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 16, horizontal: 8.0),
|
padding: const EdgeInsets.symmetric(vertical: 16, horizontal: 8.0),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user