You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
HMG_QLine/lib/views/common_widgets/app_footer.dart

111 lines
4.9 KiB
Dart

import 'package:flutter/material.dart';
import 'package:hmg_qline/view_models/screen_config_view_model.dart';
import 'package:marquee/marquee.dart';
import 'package:provider/provider.dart';
import 'package:hmg_qline/constants/app_constants.dart';
import 'package:hmg_qline/utilities/enums.dart';
import 'package:hmg_qline/views/common_widgets/app_texts_widget.dart';
import 'package:hmg_qline/views/view_helpers/size_config.dart';
class AppFooter extends StatelessWidget {
const AppFooter({super.key});
@override
Widget build(BuildContext context) {
return Consumer(builder: (BuildContext context, ScreenConfigViewModel screenConfigVM, Widget? child) {
return Container(
color: Colors.grey.withOpacity(0.1),
height: SizeConfig.getHeightMultiplier() * 0.7,
width: double.infinity,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
const SizedBox(width: 20),
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
AppText(
AppStrings.poweredBy,
fontSize: SizeConfig.getWidthMultiplier() * 2,
),
Text(screenConfigVM.currentScreenIP,
style: TextStyle(
fontWeight: FontWeight.w500,
fontSize: SizeConfig.getWidthMultiplier() * 2.2,
)),
Row(
children: [
InkWell(
onTap: () {
screenConfigVM.updateCurrentScreenRotation(ScreenOrientationEnum.portraitUp);
},
child: Icon(
Icons.arrow_upward,
size: SizeConfig.getWidthMultiplier() * 2,
),
),
InkWell(
onTap: () {
screenConfigVM.updateCurrentScreenRotation(ScreenOrientationEnum.landscapeRight);
},
child: Icon(Icons.arrow_forward, size: SizeConfig.getWidthMultiplier() * 2),
),
InkWell(
onTap: () {
screenConfigVM.updateCurrentScreenRotation(ScreenOrientationEnum.portraitDown);
},
child: Icon(
Icons.arrow_downward,
size: SizeConfig.getWidthMultiplier() * 2,
),
),
InkWell(
onTap: () {
screenConfigVM.updateCurrentScreenRotation(ScreenOrientationEnum.landscapeLeft);
},
child: Icon(
Icons.arrow_back,
size: SizeConfig.getWidthMultiplier() * 2,
),
),
],
),
],
),
const SizedBox(width: 10),
Image.asset(
AppAssets.cloudLogo,
height: SizeConfig.getHeightMultiplier() * 0.5,
),
],
),
Expanded(
child: (screenConfigVM.rssFeedModel.rssFeed == null || screenConfigVM.rssFeedModel.rssFeed!.isEmpty)
? const SizedBox()
: Container(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Marquee(
text: screenConfigVM.rssFeedModel.rssFeed ?? "",
style: TextStyle(fontWeight: FontWeight.w500, fontSize: SizeConfig.getWidthMultiplier() * 4),
scrollAxis: Axis.horizontal,
crossAxisAlignment: CrossAxisAlignment.center,
blankSpace: 20.0,
velocity: 100.0,
pauseAfterRound: const Duration(seconds: 1),
startPadding: 10.0,
accelerationDuration: const Duration(seconds: 1),
accelerationCurve: Curves.linear,
decelerationDuration: const Duration(milliseconds: 500),
decelerationCurve: Curves.easeOut,
),
),
)
],
));
});
}
}