Flutter Starter

Flutter Starter

  • Docs
  • Roadmap
  • Github
  • Hire The Creators

›Styleguide

Introduction

  • Getting started
  • Motivation
  • Installation
  • Editor setup
  • Folder structure

Styleguide

  • Add image assets
  • Add fonts assets
  • Add splash screen
  • Add color constants
  • Add theme data

Build the app

  • Add routers
  • Add dependencies

API SDK

  • API SDK overview
  • API SDK REST
  • API SDK GraphQL

State management

  • Shared overview
  • Add models
  • Add resources
  • Add BLoC

Sample apps

  • HackerNews App
  • GithubRepo List App
  • Weather App
  • Bookstore App

Test

  • Add test files

Deployment

  • Deployment

Firebase Setup Guide

  • For Android
  • For iOS

Add color constants

Go to the file /app/src/config/color_constants.dart:

import 'dart:ui';
import 'package:flutter/material.dart';

Color hexToColor(String hex) {
  assert(RegExp(r'^#([0-9a-fA-F]{6})|([0-9a-fA-F]{8})$').hasMatch(hex),
      'hex color must be #rrggbb or #rrggbbaa');

  return Color(
    int.parse(hex.substring(1), radix: 16) +
        (hex.length == 7 ? 0xff000000 : 0x00000000),
  );
}

class ColorConstants {
  static Color lightScaffoldBackgroundColor = hexToColor('#F9F9F9');
  static Color darkScaffoldBackgroundColor = hexToColor('#2F2E2E');
  static Color secondaryAppColor = hexToColor('#5E92F3');
  static Color secondaryDarkAppColor = Colors.white;
}

You can use it in a widget as shown below:

Container(
  color: ColorConstants.lightBackground,
),
← Add splash screenAdd theme data →
Docs
Getting StartedExamples
Community
TwitterDiscord
More
GitHubContribution Guidelines
Stars
Built with ❤️  at GeekyAnts.
Copyright © 2021 Flutter Starter