-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8d8832f
commit 590a4c9
Showing
20 changed files
with
474 additions
and
354 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import 'dart:async'; | ||
import 'package:connectivity_plus/connectivity_plus.dart'; | ||
|
||
class ConnectivityManager { | ||
final Connectivity _connectivity = Connectivity(); | ||
final StreamController<ConnectivityResult> _connectivityStreamController = StreamController<ConnectivityResult>.broadcast(); | ||
|
||
ConnectivityManager._internal() { | ||
_connectivity.onConnectivityChanged.listen((ConnectivityResult result) { | ||
_connectivityStreamController.add(result); | ||
}); | ||
} | ||
|
||
static final ConnectivityManager _instance = ConnectivityManager._internal(); | ||
|
||
factory ConnectivityManager() { | ||
return _instance; | ||
} | ||
|
||
Stream<ConnectivityResult> get connectivityStream => _connectivityStreamController.stream; | ||
|
||
Future<ConnectivityResult> getCurrentConnectivity() async { | ||
return await _connectivity.checkConnectivity(); | ||
} | ||
|
||
String getConnectionStatusString(ConnectivityResult result) { | ||
switch (result) { | ||
case ConnectivityResult.wifi: | ||
return 'Bağlantı durumu: Wi-Fi 🌐'; | ||
case ConnectivityResult.mobile: | ||
return 'Bağlantı durumu: Mobil Veri 📱'; | ||
case ConnectivityResult.none: | ||
return 'Bağlantı durumu: Bağlantı Yok ❌'; | ||
default: | ||
return 'Bağlantı durumu: Bilinmiyor ❔'; | ||
} | ||
} | ||
|
||
void dispose() { | ||
_connectivityStreamController.close(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import 'package:fam_works/screens/create_task_screen.dart'; | ||
import 'package:fam_works/screens/home_screen.dart'; | ||
import 'package:fam_works/screens/login_screen.dart'; | ||
import 'package:fam_works/screens/register_screen.dart'; | ||
import 'package:fam_works/screens/rotate_screen.dart'; | ||
import 'package:fam_works/views/create_task_screen.dart'; | ||
import 'package:fam_works/views/home_view.dart'; | ||
import 'package:fam_works/views/login_screen.dart'; | ||
import 'package:fam_works/views/register_screen.dart'; | ||
import 'package:fam_works/views/bottom_view.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class Routes { | ||
static Map<String, WidgetBuilder> get appRoutes => { | ||
'/login': (context) => LoginScreen(), | ||
'/register': (context) => const RegisterScreen(), | ||
'/home': (context) => const HomeScreen(), | ||
'/home': (context) => const HomeView(), | ||
'/create-task': (context) => CreateTaskScreen(), | ||
'/rotate': (context) => const MyBottomNavigationBar(), | ||
'/rotate': (context) => const BottomView(), | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import 'package:fam_works/views/home_view.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
abstract class HomeViewModel extends State<HomeView> { | ||
|
||
} |
2 changes: 1 addition & 1 deletion
2
lib/screens/activity_screen.dart → lib/views/activity_screen.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.