You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.6 KiB

2 weeks ago
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
const Color primaryColor = Color(0XFF1D7AFC);
const Color secondaryColor = Color(0XFFBFE0ED);
const Color greyColor = Color(0XFF7E7F80);
TextStyle fontTextStyle(double fontSize,Color fontColor,FontWeight weight) {
return GoogleFonts.inter(
textStyle: TextStyle(
fontSize: fontSize,
fontWeight: weight,
color:fontColor,
),
);
}
InputDecoration textFormFieldDecoration(IconData icon,var text){
return InputDecoration(
counterText: '',
filled: false,
fillColor: Colors.white,
/*prefixIcon: Icon(
icon,
color: Colors.white,
),*/
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(4.0),
borderSide: BorderSide(color: greyColor,
width: 1, )),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(4.0),
borderSide: BorderSide(color: Color(0XFF1D7AFC),width: 2,),
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(4.0),
borderSide: BorderSide(color: greyColor),
),
labelText: text,
labelStyle:fontTextStyle(14,Color(0XFF7E7F80),FontWeight.w400),
/* TextStyle(color: greyColor, fontWeight: FontWeight.bold //<-- SEE HERE
),*/
);
}
class AppSettings{
static Future<bool> internetConnectivity() async {
try {
final result = await InternetAddress.lookup('google.com');
if (result.isNotEmpty && result[0].rawAddress.isNotEmpty) {
return true;
}
} on SocketException catch (_) {
return false;
}
return false;
}
}