show admin

This commit is contained in:
Dmitry 2024-06-16 22:41:56 +03:00
parent d1d2b712f8
commit 1abd80e9ba
3 changed files with 27 additions and 23 deletions

View file

@ -94,6 +94,33 @@ class ProfilePage extends StatelessWidget {
),
],
),
if (SHOW_ADMIN)
Row(
children: [
Expanded(
child: GestureDetector(
onTap: () {
locator.packManager.clearCache();
},
child: Container(
alignment: Alignment.center,
color: Colors.white,
margin: EdgeInsets.all(8.0),
child: Text('Clear cache'),
height: 40.h,
),
),
),
Expanded(
child: SharedPrefButton<bool>(
builder: (v, _) =>
(v ?? false) ? Text('PROD') : Text('TEST'),
spKey: 'env',
setOnTap: (v) => !(v ?? false),
),
),
],
),
Expanded(
child: StreamBuilder(
stream: locator.userManager.userStateHolder.asStream,

View file

@ -70,29 +70,6 @@ class _PacksMenuWidgetState extends State<PacksMenuWidget> {
),
),
),
if (SHOW_ADMIN)
Column(
children: [
GestureDetector(
onTap: () {
locator.packManager.clearCache();
},
child: Container(
alignment: Alignment.center,
color: Colors.white,
margin: EdgeInsets.all(8.0),
child: Text('Clear cache'),
height: 40.h,
),
),
SharedPrefButton<bool>(
builder: (v, _) =>
(v ?? false) ? Text('PROD') : Text('TEST'),
spKey: 'env',
setOnTap: (v) => !(v ?? false),
),
],
),
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),