Skip to content

Instantly share code, notes, and snippets.

View AbedElazizShe's full-sized avatar

Abed Elaziz Shehadeh AbedElazizShe

  • SICPA
  • Cyberjaya, Malaysia
View GitHub Profile
@AbedElazizShe
AbedElazizShe / db_helper.dart
Created March 3, 2020 11:10
Flutter SQLite Database Helper
import 'package:flutter_ebook_shop_app/utils/constants.dart';
import 'package:sqflite/sqflite.dart' as sql;
import 'package:path/path.dart' as path;
/*
* Created by AbedElaziz Shehadeh on 1st March, 2020
* elaziz.shehadeh@gmail.com
*/
class DBHelper {
static final DBHelper _instance = DBHelper._internal();
@AbedElazizShe
AbedElazizShe / AndroidManifest.xml
Created December 7, 2020 16:06
AndroidManifest
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.abedelazizshe.flutter_lottie_splash_app">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="flutter_lottie_splash_app"
@AbedElazizShe
AbedElazizShe / splash_view.xml
Created December 7, 2020 16:19
splash view layout
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.airbnb.lottie.LottieAnimationView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
@AbedElazizShe
AbedElazizShe / SplashView.kt
Created December 7, 2020 16:29
Splash View class
import android.content.Context
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import io.flutter.embedding.android.SplashScreen
class SplashView : SplashScreen {
override fun createSplashView(context: Context, savedInstanceState: Bundle?): View? =
LayoutInflater.from(context).inflate(R.layout.splash_view, null, false)
@AbedElazizShe
AbedElazizShe / MainActivity.kt
Created December 7, 2020 16:35
Main Activity class
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.android.SplashScreen
class MainActivity: FlutterActivity() {
override fun provideSplashScreen(): SplashScreen? = SplashView()
}
import UIKit
import Flutter
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
lazy var flutterEngine = FlutterEngine(name: "MyApp")
override func application(
_ application: UIApplication,
import UIKit
import Lottie
public class SplashViewController: UIViewController {
private var animationView: AnimationView?
public override func viewDidAppear(_ animated: Bool) {
animationView = .init(name: "splash_screen")
animationView!.frame = view.bounds
import 'package:domain/src/models/article/article_model.dart';
abstract class ArticlesRepository {
Future<List<ArticleModel>> getMostEmailedArticles();
Future<List<ArticleModel>> getMostViewedArticles();
Future<List<ArticleModel>> getMostSharedArticles();
Future<int> saveArticles(String articles, String type);
import 'dart:convert';
import 'package:domain/domain.dart';
import 'package:injectable/injectable.dart';
@singleton
class GetArticlesUseCase {
GetArticlesUseCase(this.articlesRepository);
final ArticlesRepository articlesRepository;
import 'dart:convert';
import 'package:domain/domain.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mockito/annotations.dart';
import 'package:mockito/mockito.dart';
import '../../mock/mock_article_model.dart';
import 'get_articles_use_case_test.mocks.dart';