18 changed files with 590 additions and 542 deletions
			
			
		@ -0,0 +1,29 @@ | 
				
			|||||||
 | 
					part of '../neon_news.dart'; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class NewsFeedFloatingActionButton extends StatelessWidget { | 
				
			||||||
 | 
					  const NewsFeedFloatingActionButton({ | 
				
			||||||
 | 
					    required this.bloc, | 
				
			||||||
 | 
					    this.folderID, | 
				
			||||||
 | 
					    super.key, | 
				
			||||||
 | 
					  }); | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  final NewsBloc bloc; | 
				
			||||||
 | 
					  final int? folderID; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @override | 
				
			||||||
 | 
					  Widget build(final BuildContext context) => FloatingActionButton( | 
				
			||||||
 | 
					        onPressed: () async { | 
				
			||||||
 | 
					          final result = await showDialog<List>( | 
				
			||||||
 | 
					            context: context, | 
				
			||||||
 | 
					            builder: (final context) => NewsAddFeedDialog( | 
				
			||||||
 | 
					              bloc: bloc, | 
				
			||||||
 | 
					              folderID: folderID, | 
				
			||||||
 | 
					            ), | 
				
			||||||
 | 
					          ); | 
				
			||||||
 | 
					          if (result != null) { | 
				
			||||||
 | 
					            bloc.addFeed(result[0] as String, result[1] as int?); | 
				
			||||||
 | 
					          } | 
				
			||||||
 | 
					        }, | 
				
			||||||
 | 
					        child: const Icon(Icons.add), | 
				
			||||||
 | 
					      ); | 
				
			||||||
 | 
					} | 
				
			||||||
@ -0,0 +1,24 @@ | 
				
			|||||||
 | 
					part of '../neon_news.dart'; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class NewsFolderFloatingActionButton extends StatelessWidget { | 
				
			||||||
 | 
					  const NewsFolderFloatingActionButton({ | 
				
			||||||
 | 
					    required this.bloc, | 
				
			||||||
 | 
					    super.key, | 
				
			||||||
 | 
					  }); | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  final NewsBloc bloc; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @override | 
				
			||||||
 | 
					  Widget build(final BuildContext context) => FloatingActionButton( | 
				
			||||||
 | 
					        onPressed: () async { | 
				
			||||||
 | 
					          final result = await showDialog<String>( | 
				
			||||||
 | 
					            context: context, | 
				
			||||||
 | 
					            builder: (final context) => const NewsCreateFolderDialog(), | 
				
			||||||
 | 
					          ); | 
				
			||||||
 | 
					          if (result != null) { | 
				
			||||||
 | 
					            bloc.createFolder(result); | 
				
			||||||
 | 
					          } | 
				
			||||||
 | 
					        }, | 
				
			||||||
 | 
					        child: const Icon(Icons.add), | 
				
			||||||
 | 
					      ); | 
				
			||||||
 | 
					} | 
				
			||||||
@ -0,0 +1,32 @@ | 
				
			|||||||
 | 
					part of '../neon_notes.dart'; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class NotesFloatingActionButton extends StatelessWidget { | 
				
			||||||
 | 
					  const NotesFloatingActionButton({ | 
				
			||||||
 | 
					    required this.bloc, | 
				
			||||||
 | 
					    this.category, | 
				
			||||||
 | 
					    super.key, | 
				
			||||||
 | 
					  }); | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  final NotesBloc bloc; | 
				
			||||||
 | 
					  final String? category; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @override | 
				
			||||||
 | 
					  Widget build(final BuildContext context) => FloatingActionButton( | 
				
			||||||
 | 
					        onPressed: () async { | 
				
			||||||
 | 
					          final result = await showDialog<List>( | 
				
			||||||
 | 
					            context: context, | 
				
			||||||
 | 
					            builder: (final context) => NotesCreateNoteDialog( | 
				
			||||||
 | 
					              bloc: bloc, | 
				
			||||||
 | 
					              category: category, | 
				
			||||||
 | 
					            ), | 
				
			||||||
 | 
					          ); | 
				
			||||||
 | 
					          if (result != null) { | 
				
			||||||
 | 
					            bloc.createNote( | 
				
			||||||
 | 
					              title: result[0] as String, | 
				
			||||||
 | 
					              category: result[1] as String? ?? '', | 
				
			||||||
 | 
					            ); | 
				
			||||||
 | 
					          } | 
				
			||||||
 | 
					        }, | 
				
			||||||
 | 
					        child: const Icon(Icons.add), | 
				
			||||||
 | 
					      ); | 
				
			||||||
 | 
					} | 
				
			||||||
					Loading…
					
					
				
		Reference in new issue