|
1 | | -# technew |
| 1 | +# TechNews Flutter App |
2 | 2 |
|
3 | | -A new Flutter project. |
| 3 | +TechNews is a Flutter-based mobile application that provides the latest tech news. |
4 | 4 |
|
5 | 5 | ## Getting Started |
6 | 6 |
|
7 | | -This project is a starting point for a Flutter application. |
| 7 | +These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. |
8 | 8 |
|
9 | | -A few resources to get you started if this is your first Flutter project: |
| 9 | +### Prerequisites |
10 | 10 |
|
11 | | -- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) |
12 | | -- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) |
| 11 | +Ensure you have the following installed on your machine: |
13 | 12 |
|
14 | | -For help getting started with Flutter development, view the |
15 | | -[online documentation](https://docs.flutter.dev/), which offers tutorials, |
16 | | -samples, guidance on mobile development, and a full API reference. |
| 13 | +- [Flutter](https://flutter.dev/docs/get-started/install) (version 2.0.0 or later) |
| 14 | +- [Dart](https://dart.dev/get-dart) |
| 15 | +- [Android Studio](https://developer.android.com/studio) (for Android development) |
| 16 | +- [Xcode](https://developer.apple.com/xcode/) (for iOS development, macOS only) |
| 17 | +- [Visual Studio Code](https://code.visualstudio.com/) (optional, but recommended) |
| 18 | + |
| 19 | +### Installation |
| 20 | + |
| 21 | +1. **Clone the repository:** |
| 22 | + ```sh |
| 23 | + git clone https://github.com/codewithkd77/technews-flutter.git |
| 24 | + cd technews-flutter |
| 25 | + ``` |
| 26 | + |
| 27 | +2. **Install dependencies:** |
| 28 | + ```sh |
| 29 | + flutter pub get |
| 30 | + ``` |
| 31 | + |
| 32 | +3. **Configure API:** |
| 33 | + - Open the `lib/services/news_service.dart` file. |
| 34 | + - Replace the placeholder API URL and API key with your own. |
| 35 | + ```dart |
| 36 | + class NewsService { |
| 37 | + static const String apiUrl = 'YOUR_API_URL'; |
| 38 | + static const String apiKey = 'YOUR_API_KEY'; |
| 39 | + } |
| 40 | + ``` |
| 41 | + |
| 42 | +4. **Run the project:** |
| 43 | + - **Android:** |
| 44 | + - Ensure you have an Android emulator running or a physical device connected. |
| 45 | + - Run the following command: |
| 46 | + ```sh |
| 47 | + flutter run |
| 48 | + ``` |
| 49 | + - **iOS:** |
| 50 | + - Ensure you have an iOS simulator running or a physical device connected. |
| 51 | + - Run the following command: |
| 52 | + ```sh |
| 53 | + flutter run |
| 54 | + ``` |
| 55 | + |
| 56 | +### Building the APK (Android) |
| 57 | + |
| 58 | +To build the APK file for Android, run the following command: |
| 59 | +```sh |
| 60 | +flutter build apk --release |
| 61 | +``` |
| 62 | + |
| 63 | +The APK file will be generated in the `build/app/outputs/flutter-apk/` directory. |
| 64 | + |
| 65 | +### Building the iOS App |
| 66 | + |
| 67 | +To build the iOS app, run the following command: |
| 68 | +```sh |
| 69 | +flutter build ios --release |
| 70 | +``` |
| 71 | + |
| 72 | +Note: You need a macOS machine with Xcode installed to build the iOS app. |
| 73 | + |
| 74 | +### Contributing |
| 75 | + |
| 76 | +If you want to contribute to this project, please fork the repository and create a pull request with your changes. |
| 77 | + |
| 78 | +### License |
| 79 | + |
| 80 | +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. |
0 commit comments