10. Dart - Custom Classes and Importing Dart Files

 Create a custom class inside a separate Dart file:


example.dart


class Human {

    String name = "bob";

    int age = 30;

};


Importing Dart files into another file:

import 'example.dart';


Using Custom Class properties inside flutter:

Human personone = Human();


Text('${personone.name}'),


Comments

Popular posts from this blog

2. FreeCodeCamp - Dynamic Programming - Learn to Solve Algorithmic Problems & Coding Challenges

20. Data Analytics - Analyze Data to Answer Questions - Week 1

3. Algorithms - Selection Sort