Refactor menu view and add build number and environment label

This commit is contained in:
mohammad
2025-05-12 10:58:16 +03:00
parent 9c6ab888a7
commit 21cad0d9e8
3 changed files with 21 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import 'package:syncrow_app/features/auth/bloc/auth_cubit.dart';
import 'package:syncrow_app/features/menu/bloc/menu_cubit.dart';
import 'package:syncrow_app/features/menu/view/widgets/menu_list.dart';
import 'package:syncrow_app/features/menu/view/widgets/profile/profile_tab.dart';
import 'package:syncrow_app/features/shared_widgets/build_number_environment.dart';
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart';
import 'package:syncrow_app/utils/context_extension.dart';
@ -51,6 +52,7 @@ class MenuView extends StatelessWidget {
],
),
),
buildNumberAndEnvironmentLabel()
],
),
);

View File

@ -0,0 +1,16 @@
import 'package:flutter/material.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:syncrow_app/main.dart';
Widget buildNumberAndEnvironmentLabel() {
String envNAME = dotenv.env['ENV_NAME'] ?? '';
return SizedBox(
child: Center(
child: Text(
'\n$envNAME \nBuild Number $buildNumber',
textAlign: TextAlign.center,
),
),
);
}

View File

@ -9,6 +9,9 @@ import 'package:syncrow_app/utils/bloc_observer.dart';
import 'package:syncrow_app/utils/helpers/localization_helpers.dart';
import 'my_app.dart';
const String buildNumber = '1.0.30+17';
void main() {
//to observe the state of the blocs in the output console
Bloc.observer = MyBlocObserver();