Skip to content

SamedHrmn/flutter-works

Repository files navigation

flutter-works

This repo contains my personal Flutter practices. Projects and contents are as follows:
  • firebase-work

    This project created for practicing firebase firestore crud operations with Provider state management. I used MVVM architecture simply. File structures as following:
     lib--                                        App Features:
         |                                            - Sign In,Sign Up Firebase
         |__model                                     - CRUD operations for mottos.
                |__motto_model.dart
         |__repository                            
                |__my_respository.dart
         |__service
                |__firebase_auth.service.dart
                |__firestore_service.dart
         |__utils
                |__locator.dart
         |__view
                |__home_page.dart
                |__login_page.dart
                |__register_page.dart
                |__router_page.dart
         |__view_model
                |__motto_view_model.dart
         form_screen.dart
         main.dart

  • flask-connection

    This project occurs of two parts. Part one as flask_api converting a rgb image into black-white format and return as a respone. And part wo as flutter_client show this responses. For example:

                                           

  • food_app_design

    This project created for Flutter design practicing. I used *curved_navigation_bar* and *carousel_slider* package.

                                     

  • generic_http_model_basic

    This project implements generic type model for http responses. For requests I used jsonplaceholder service. File structures as following:
     lib--                                        
         |                                            
         |__model                                  
                |__base_model.dart
                |__post_model.dart
                |__user_model.dart
         |__service
                |__base_service.dart
                |__jsonplaceholder_service.dart
         |__view
                |__jsonplaceholder_view.dart
         |__view_model
                |__jsonplaceholder_viewmodel.dart
         main.dart

       Generic models handled by IBaseModel and IBaseService class.

abstract class IBaseService {
    Future<dynamic> get<T extends IBaseModel>({String path, IBaseModel model});
}

abstract class IBaseModel<T> {
    Map<String, Object> toJson();
    T fromJson(Map<String, Object> json);
}

  • method_channel_notification

    This project use method channel and access native kotlin code for show in app notification. Flutter method channel requests handled by this code below side of Kotlin,
private val CHANNEL = "notification"
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL).setMethodCallHandler { call, result ->
       if (call.method == "showNotification") {
           showNotification()
           result.success("Service is started !")
       }
       if(call.method == "removeNotification"){
           removeNotification()
           result.success("Notification removed !")
       }
   }
}

       In Flutter side we created MethodChannel instance and invoke methods that must be written.showNotification and        removeNotification must be implemented in native side.

showNotification() async {
 var response =
     await MyHome.platformChannel.invokeMethod('showNotification');
 setState(() {
   _response = response;
 });
}

removeNotification() async {
 var response =
     await MyHome.platformChannel.invokeMethod('removeNotification');
 setState(() {
   _response = response;
 });
}

  • pose_detection

    This project detect some body parts and apply a bunny filter for head via use PoseNet model. *tflite* and *camera* plugin was used for this. Model loading code section is like this below,
loadModel() async {
    String model = await Tflite.loadModel(model: AssetConstants.POSE_MODEL_TFLITE);
    setState(() {
      _model = model;
    });
  }

                                                               

  • vokal_baglama_detection_tflite

    This project detect my vocal sound and my baglama instrument sound. A custom .tflite model created via Google Teachable Machine was used for this project.

                              

     lib--                                        App Features:
         |                                            - BloC state management
         |__models                                    - Refresh view and fetch api data
                |__weather_model.dart                 - Dynamic theme
         |__repositories                           
                |_weather_api_client.dart
                |_weather_repository.dart
         |__view
                |__city_selection_screen.dart
                |__weather_screen.dart
         |__viewmodels\blocs
                |__theme_bloc
                        |__theme_bloc.dart
                        |__theme_event.dart
                        |__theme_state.dart
                |__weather_bloc
                        |__weather_bloc.dart
                        |__weather_state.dart
                        |__weather_event.dart
         |__widgets
                |__combined_weather_temperature.dart
                |__gradient_container_widget.dart
                |__last_updated_widget.dart
                |__location_widget.dart.dart
                |__temperature_widget.dart
                |__weather_condition_widget.dart
         main.dart

                                     

Licence

MIT License

Copyright (c) 2021 SamedHrmn

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.