Project Structure

Project Structure

Once you download the starter code for the 🚧 project , and open it in your favourite editor (VSCode), you will see some 📄 files we have here

project structure

  • - [ ] 📄main.dart - that's is the start of the app
  • - [ ] 📄data.dart - which holds all their data in there we have place
  • - [ ] models📁 folder different models in the app.
  • - [ ] helpers📁 folder for app helpers and utilities.
    - \[ ] 📄 `**app_constants.dart**` holds constants for color themes and common constants that can be used across the app.

The last thing to note is how we imported the images into our app. If we go into a pubspec.yaml file we can see that if we scroll down to assets all I did was uncomment.

This images line and then replace it with assets/images and that's how we import all of our images from our assets images directory.

Note : 📄main.dart

// ignore_for_file: prefer_const_constructors
import 'package:flutter/material.dart';
import 'helpers/app_constants.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'devfest - 2022 - chat app workshop',
theme: ThemeData(
primaryColor: AppConstants.hexToColor(AppConstants.APP_PRIMARY_COLOR),
backgroundColor:
AppConstants.hexToColor(AppConstants.APP_BACKGROUND_COLOR),
primaryColorLight:
AppConstants.hexToColor(AppConstants.APP_PRIMARY_COLOR_LIGHT),
dividerColor:
AppConstants.hexToColor(AppConstants.APP_BACKGROUND_COLOR_GRAY),
textTheme: TextTheme(
caption: TextStyle(
color: AppConstants.hexToColor(
AppConstants.APP_PRIMARY_FONT_COLOR_WHITE)),
),
),
home: const MyHomePage(title: 'devfest - 2022 - workshops'),
);
}
}
..