color_picker_field 2.1.0 color_picker_field: ^2.1.0 copied to clipboard
Color Picker field for Material and Cupertino, including a Radial Color picker(Hue based)
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'cupertino_home_page.dart';
import 'home_page.dart';
// void main() => runApp(MyMaterialApp());
void main() => runApp(const MyCupertinoApp());
class MyCupertinoApp extends StatelessWidget {
const MyCupertinoApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return const CupertinoApp(
title: 'Color Picker',
theme: CupertinoThemeData(
primaryColor: CupertinoColors.activeOrange,
brightness: Brightness.light,
),
home: CupertinoHomePage(title: 'Color Picker Cupertino'),
localizationsDelegates: [
GlobalCupertinoLocalizations.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate
],
locale: Locale('en_US'),
);
}
}
class MyMaterialApp extends StatelessWidget {
const MyMaterialApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Color Picker',
theme: ThemeData(
primarySwatch: Colors.pink,
brightness: Brightness.light,
),
home: const MaterialHomePage(title: 'Color Picker Material'),
localizationsDelegates: const [
GlobalCupertinoLocalizations.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate
],
locale: const Locale('en_US'),
);
}
}