mirror of
				https://github.com/AppFlowy-IO/AppFlowy.git
				synced 2025-10-30 17:38:40 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			29 lines
		
	
	
		
			865 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			865 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
| import 'package:appflowy_backend/protobuf/flowy-database2/setting_entities.pb.dart';
 | |
| import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
 | |
| 
 | |
| ViewLayoutPB viewLayoutFromDatabaseLayout(DatabaseLayoutPB databaseLayout) {
 | |
|   switch (databaseLayout) {
 | |
|     case DatabaseLayoutPB.Board:
 | |
|       return ViewLayoutPB.Board;
 | |
|     case DatabaseLayoutPB.Calendar:
 | |
|       return ViewLayoutPB.Calendar;
 | |
|     case DatabaseLayoutPB.Grid:
 | |
|       return ViewLayoutPB.Grid;
 | |
|     default:
 | |
|       throw UnimplementedError;
 | |
|   }
 | |
| }
 | |
| 
 | |
| DatabaseLayoutPB databaseLayoutFromViewLayout(ViewLayoutPB viewLayout) {
 | |
|   switch (viewLayout) {
 | |
|     case ViewLayoutPB.Board:
 | |
|       return DatabaseLayoutPB.Board;
 | |
|     case ViewLayoutPB.Calendar:
 | |
|       return DatabaseLayoutPB.Calendar;
 | |
|     case ViewLayoutPB.Grid:
 | |
|       return DatabaseLayoutPB.Grid;
 | |
|     default:
 | |
|       throw UnimplementedError;
 | |
|   }
 | |
| }
 | 
