feat: Add beta environment indicator to layout
This commit is contained in:
parent
d9ad7581bf
commit
ad4b24dd78
@ -18,6 +18,7 @@ import 'package:marco/widgets/custom_pop_menu.dart';
|
|||||||
import 'package:marco/helpers/services/storage/local_storage.dart';
|
import 'package:marco/helpers/services/storage/local_storage.dart';
|
||||||
import 'package:marco/model/employee_info.dart';
|
import 'package:marco/model/employee_info.dart';
|
||||||
import 'package:marco/helpers/widgets/avatar.dart';
|
import 'package:marco/helpers/widgets/avatar.dart';
|
||||||
|
import 'package:marco/helpers/services/api_endpoints.dart';
|
||||||
|
|
||||||
class Layout extends StatelessWidget {
|
class Layout extends StatelessWidget {
|
||||||
final Widget? child;
|
final Widget? child;
|
||||||
@ -30,6 +31,7 @@ class Layout extends StatelessWidget {
|
|||||||
|
|
||||||
Layout({super.key, this.child, this.floatingActionButton});
|
Layout({super.key, this.child, this.floatingActionButton});
|
||||||
|
|
||||||
|
bool get isBetaEnvironment => ApiEndpoints.baseUrl.contains("stage");
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MyResponsive(builder: (BuildContext context, _, screenMT) {
|
return MyResponsive(builder: (BuildContext context, _, screenMT) {
|
||||||
@ -51,6 +53,33 @@ class Layout extends StatelessWidget {
|
|||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
actions: [
|
actions: [
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
MySpacing.width(6),
|
||||||
|
if (isBetaEnvironment)
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
vertical: 17.0, horizontal: 8.0),
|
||||||
|
child: Container(
|
||||||
|
padding:
|
||||||
|
const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.blueAccent,
|
||||||
|
borderRadius: BorderRadius.circular(4),
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
'BETA',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 12,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
MySpacing.width(6),
|
MySpacing.width(6),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user