Skip to content

Instantly share code, notes, and snippets.

View Chinecherem20199's full-sized avatar

Chinecherem Augustina Ugwuanyi Chinecherem20199

View GitHub Profile
@Chinecherem20199
Chinecherem20199 / main.dart
Created December 4, 2023 13:18
Product page
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:shopy/models/dommydata/sample.dart';
import 'package:shopy/presentation/widget/product_details.dart';
import '../../models/dommydata/products.dart';
import '../../resources/color_manager.dart';
import '../../resources/sized_manager.dart';
class Recommens extends StatefulWidget {
//final DummyProduct recomendsProduct;
import 'package:air_hukup/prensentation/resources/color_manager.dart';
import 'package:air_hukup/prensentation/resources/style_manager.dart';
import 'package:flutter/material.dart';
import '../resources/value_manager.dart';
class GenderPage extends StatefulWidget {
const GenderPage({Key? key}) : super(key: key);
@override
import 'package:air_hukup/prensentation/resources/color_manager.dart';
import 'package:air_hukup/prensentation/resources/style_manager.dart';
import 'package:flutter/material.dart';
import '../resources/value_manager.dart';
class GenderPage extends StatefulWidget {
const GenderPage({Key? key}) : super(key: key);
@override
@Chinecherem20199
Chinecherem20199 / Count-Unique-array
Created January 31, 2023 13:42
Count Unique array in JavaScript DSA
function countUniqueValues(arr){
if(arr.length ===0) return 0;
let i = 0;
for(j =1; j<arr.length; j++){
if (arr[i] !== arr[j]) {
i++;
arr[i] = arr[j];
}
}
return i + 1
@Chinecherem20199
Chinecherem20199 / main.dart
Created November 14, 2022 18:56
rustic-snow-0638
import 'package:flutter/material.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
@Chinecherem20199
Chinecherem20199 / loves.dart
Created May 31, 2022 19:28
Love Random Calculator
import 'dart:math';
void main() {
loveCalculator();
}
void loveCalculator(){
int loveScore = Random().nextInt(100) + 1;
print(loveScore);
@Chinecherem20199
Chinecherem20199 / main.dart
Created May 16, 2022 12:43
Class Fundamental in Dart
//use classes to define new type
//we are used to int, String, bool, List, Map, Set, Function
//classes - blueprint for objects
//object - container that holds some data (functionality in manipulate the data)
void main() {
var myHouse = House(nuOfWindows: 8, nuOfDoors: 4, typesOfWalls: 'Brick', typesOfRoof:'Tile');
// myHouse.nrOfDoors = 10;
//
// print(myHouse.nrOfDoors);
myHouse.printHouses();
@Chinecherem20199
Chinecherem20199 / main.dart
Created May 16, 2022 11:24
forEach_map_function
void main() {
final list = [10, 20, 33];
// for (var item in list) {
// print(item);
// }
//forEach
list.forEach((item) => print(item));
list.forEach(print);
//Map Function
@Chinecherem20199
Chinecherem20199 / main.dart
Created May 16, 2022 11:02
Generic_Function_Dart
void main() {
var doubleValues = [10.2, 2.2, 3.0, 4.5, 5.5, 6.0, 7.4, 80.0, 9.0];
var stringValues = ['@','*', '&' ];
var newDoubleVlues = <double>[];
var newStringValue = <String>[];
//listOperation(doubleValues, (double val) => newDoubleValues.add(val *3));
listOperation(doubleValues,(double val) => newDoubleVlues.add(val * 5));
listOperation(stringValues,(String val)=> newStringValue.add(val * 2));
@Chinecherem20199
Chinecherem20199 / main.dart
Created May 16, 2022 10:59
Generic_Function_Dart
void main() {
var doubleValues = [10.2, 2.2, 3.0, 4.5, 5.5, 6.0, 7.4, 80.0, 9.0];
var stringValues = ['@','*', '&' ];
var newDoubleVlues = <double>[];
var newStringValue = <String>[];
//listOperation(doubleValues, (double val) => newDoubleValues.add(val *3));
listOperation(doubleValues,(double val) => newDoubleVlues.add(val * 5));
listOperation(stringValues,(String val)=> newStringValue.add(val * 2));