mirror of
				https://gitlab.com/comunic/comunicmobile
				synced 2025-11-04 04:04:18 +00:00 
			
		
		
		
	Start to build Forez main route
This commit is contained in:
		
							
								
								
									
										65
									
								
								lib/forez/ui/routes/forez_route.dart
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										65
									
								
								lib/forez/ui/routes/forez_route.dart
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,65 @@
 | 
			
		||||
import 'package:comunic/models/conversation.dart';
 | 
			
		||||
import 'package:comunic/ui/dialogs/alert_dialog.dart';
 | 
			
		||||
import 'package:comunic/ui/routes/main_route/main_route.dart';
 | 
			
		||||
import 'package:comunic/ui/routes/main_route/page_info.dart';
 | 
			
		||||
import 'package:comunic/utils/intl_utils.dart';
 | 
			
		||||
import 'package:flutter/material.dart';
 | 
			
		||||
 | 
			
		||||
/// Forez route
 | 
			
		||||
///
 | 
			
		||||
/// @author Pierre Hubert
 | 
			
		||||
 | 
			
		||||
class ForezRoute extends StatefulWidget implements MainRoute {
 | 
			
		||||
  const ForezRoute({Key key}) : super(key: key);
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  State<StatefulWidget> createState() => _MainRouteState();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/// Private implementation of HomeController
 | 
			
		||||
class _MainRouteState extends MainController {
 | 
			
		||||
  @override
 | 
			
		||||
  PageInfo get defaultPage => PageInfo(
 | 
			
		||||
      type: PageType.OTHER_PAGE, child: ForezRouteBody(), hideNavBar: true);
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  Widget build(BuildContext context) {
 | 
			
		||||
    return Container(
 | 
			
		||||
      color: Colors.blueAccent,
 | 
			
		||||
      child: SafeArea(
 | 
			
		||||
        // Avoid OS areas
 | 
			
		||||
        child: WillPopScope(
 | 
			
		||||
          onWillPop: willPop,
 | 
			
		||||
          child: Scaffold(
 | 
			
		||||
            appBar: currentPage.hideNavBar ? null : AppBar(),
 | 
			
		||||
            body: SafeArea(key: currentPage.key, child: currentPage.child),
 | 
			
		||||
          ),
 | 
			
		||||
        ),
 | 
			
		||||
      ),
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  void openConversation(Conversation conv, {fullScreen: false}) {
 | 
			
		||||
    // Forcefully open conversations in a "normal" way (do not display groups)
 | 
			
		||||
    openConversationById(conv.id, fullScreen: fullScreen);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  void openGroup(int groupID, {int conversationID}) {
 | 
			
		||||
    alert(context,
 | 
			
		||||
        tr("This feature is available only in the Comunic application!"));
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
class ForezRouteBody extends StatefulWidget {
 | 
			
		||||
  @override
 | 
			
		||||
  _ForezRouteBodyState createState() => _ForezRouteBodyState();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
class _ForezRouteBodyState extends State<ForezRouteBody> {
 | 
			
		||||
  @override
 | 
			
		||||
  Widget build(BuildContext context) {
 | 
			
		||||
    return Text("yolo");
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user