2023-10-06 04:43:37 +00:00
|
|
|
import 'package:flutter/material.dart';
|
2023-10-06 12:19:06 +00:00
|
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
2023-10-07 13:30:44 +00:00
|
|
|
import 'package:flutter_progress_hud/flutter_progress_hud.dart';
|
|
|
|
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
2023-10-06 04:43:37 +00:00
|
|
|
import 'package:flutter_zoom_drawer/flutter_zoom_drawer.dart';
|
|
|
|
import 'package:fluttericon/font_awesome5_icons.dart';
|
2023-10-06 12:19:06 +00:00
|
|
|
import 'package:unit2/bloc/offline/offline_bloc/offline_bloc.dart';
|
2023-10-06 04:43:37 +00:00
|
|
|
import 'package:unit2/model/offline/offlane_modules.dart';
|
2023-11-10 08:38:47 +00:00
|
|
|
import 'package:unit2/screens/offline/passo/passo_offline_dashboard.dart';
|
2023-10-06 04:43:37 +00:00
|
|
|
import 'package:unit2/screens/unit2/homepage.dart/components/dashboard/shared_card_label.dart';
|
|
|
|
import 'package:unit2/theme-data.dart/colors.dart';
|
|
|
|
|
2023-11-10 08:38:47 +00:00
|
|
|
import '../passo/passo_main_dashboard.dart';
|
|
|
|
|
2023-10-06 04:43:37 +00:00
|
|
|
class OfflineModuleScreen extends StatelessWidget {
|
2023-10-06 12:19:06 +00:00
|
|
|
const OfflineModuleScreen({super.key});
|
2023-10-06 04:43:37 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Scaffold(
|
|
|
|
appBar: AppBar(
|
|
|
|
backgroundColor: primary,
|
|
|
|
title: const Text("Offline Mode"),
|
|
|
|
centerTitle: true,
|
|
|
|
leading: IconButton(
|
|
|
|
onPressed: () {
|
|
|
|
ZoomDrawer.of(context)!.toggle();
|
|
|
|
},
|
|
|
|
icon: const Icon(
|
|
|
|
Icons.menu,
|
|
|
|
color: Colors.white,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
2023-10-07 13:30:44 +00:00
|
|
|
body: ProgressHUD(
|
|
|
|
backgroundColor: Colors.black87,
|
|
|
|
indicatorWidget: const SpinKitFadingCircle(color: Colors.white),
|
|
|
|
child: BlocConsumer<OfflineBloc, OfflineState>(
|
|
|
|
listener: (context, state) {
|
|
|
|
if (state is OfflineLoadingState) {}
|
|
|
|
},
|
|
|
|
builder: (context, state) {
|
|
|
|
if (state is OfflineModeState) {
|
|
|
|
return Padding(
|
|
|
|
padding: const EdgeInsets.all(24),
|
|
|
|
child: GridView.count(
|
|
|
|
shrinkWrap: true,
|
|
|
|
crossAxisCount: 4,
|
|
|
|
crossAxisSpacing: 8,
|
|
|
|
mainAxisSpacing: 10,
|
|
|
|
physics: const BouncingScrollPhysics(),
|
|
|
|
padding: const EdgeInsets.symmetric(
|
|
|
|
vertical: 5, horizontal: 5),
|
|
|
|
children: state.offlineModules
|
|
|
|
.map((e) => CardLabel(
|
|
|
|
icon: FontAwesome5.eye,
|
2024-07-11 01:27:35 +00:00
|
|
|
title: "Rpass Offline",
|
2023-10-07 13:30:44 +00:00
|
|
|
ontap: () {
|
|
|
|
Navigator.push(context,
|
|
|
|
MaterialPageRoute(builder: ((context) {
|
2024-02-08 00:52:29 +00:00
|
|
|
return PassoOfflineMainScreen(
|
|
|
|
state.offlineProfile);
|
2023-10-07 13:30:44 +00:00
|
|
|
})));
|
|
|
|
}))
|
|
|
|
.toList()),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
return Container();
|
|
|
|
},
|
|
|
|
),
|
2023-10-06 04:43:37 +00:00
|
|
|
));
|
|
|
|
}
|
|
|
|
}
|