cids_cgi 1.1.2 cids_cgi: ^1.1.2 copied to clipboard
CGI Design System for Flutter
import 'package:flutter/material.dart';
import 'package:cids_cgi/cids_cgi.dart';
import './router.dart' as r;
var defaultPage;
BuildContext context1;
final biometricsHandler = BiometricsHandler(autenticacaoPage: (widget) {
Navigator.of(context1).pushAndRemoveUntil(
r.SlideRightRoute(widget: widget), (Route<dynamic> route) => false);
}, homePage: () {
Navigator.of(context1)
.pushNamedAndRemoveUntil('/home', (Route<dynamic> route) => false);
});
void main() async {
WidgetsFlutterBinding.ensureInitialized();
biometricsHandler.listen();
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
final temaClaro = ThemeData(
appBarTheme: AppBarTheme(
brightness: Brightness.light,
color: Colors.transparent,
iconTheme: IconThemeData(color: Colors.black),
textTheme: TextTheme(
headline6: TextStyle(color: Colors.black, fontSize: 18))),
textTheme: TextTheme(
headline6: TextStyle(
color: Color(0xff1D2745),
),
headline1: TextStyle(
color: Color(0xff1D2745),
),
),
primaryColor: Color(0xff1D2745),
backgroundColor: Color(0xff1D2745),
fontFamily: 'PT_Sans-Narrow-Web',
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
buttonTheme: ButtonThemeData(
buttonColor: Color(0xffff6600), textTheme: ButtonTextTheme.primary));
final temaEscuro = ThemeData(
appBarTheme: AppBarTheme(
iconTheme: IconThemeData(color: Colors.white),
color: Colors.transparent,
textTheme: TextTheme(
headline6: TextStyle(color: Colors.white, fontSize: 18))),
textTheme: TextTheme(
headline6: TextStyle(
color: Colors.white,
),
headline1: TextStyle(
color: Color(0xff1D2745),
),
),
backgroundColor: Colors.white,
brightness: Brightness.dark,
fontFamily: 'PT_Sans-Narrow-Web',
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
buttonTheme: ButtonThemeData(
buttonColor: Color(0xffff6600), textTheme: ButtonTextTheme.primary));
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: temaClaro,
darkTheme: temaEscuro,
themeMode: ThemeMode.system,
home: defaultPage,
onGenerateRoute: r.Router.generateRoute);
}
}
class MyHome extends StatefulWidget {
@override
_MyHomeState createState() => _MyHomeState();
}
class _MyHomeState extends State<MyHome> {
@override
void initState() {
super.initState();
context1 = context;
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
actions: [IconButton(icon: Icon(Icons.settings), onPressed: () {})],
title: const Text('CIDS for dev'),
),
);
}
}