Skip to content

Commit

Permalink
Merge branch 'master' into add_native_names
Browse files Browse the repository at this point in the history
  • Loading branch information
atn832 authored Sep 2, 2024
2 parents 04af16d + ffff5d8 commit 59e0737
Show file tree
Hide file tree
Showing 18 changed files with 210 additions and 46 deletions.
12 changes: 8 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
## 0.4.4+1

Fixed deprecated TextStyles. Thank you [sczesla](https://github.com/sczesla) and [AhmedOs90](https://github.com/AhmedOs90)!

## 0.4.3

- Fixed bug when Language was being used as a Key in a Set or Map.
Fixed bug when Language was being used as a Key in a Set or Map.

## 0.4.2

- Implemented LanguagePickerDropdownController.
Implemented LanguagePickerDropdownController.

## 0.4.1

- Restored finding a language by ISO code as `Language.fromIsoCode(isoCode)`.
Restored finding a language by ISO code as `Language.fromIsoCode(isoCode)`.

## 0.4.0

Expand All @@ -26,7 +30,7 @@ Other:

## 0.3.0+1

- Documented usage example.
Documented usage example.

## 0.3.0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
package io.flutter.plugins;

import io.flutter.plugin.common.PluginRegistry;
import androidx.annotation.Keep;
import androidx.annotation.NonNull;
import io.flutter.Log;

import io.flutter.embedding.engine.FlutterEngine;

/**
* Generated file. Do not edit.
* This file is generated by the Flutter tool based on the
* plugins that support the Android platform.
*/
@Keep
public final class GeneratedPluginRegistrant {
public static void registerWith(PluginRegistry registry) {
if (alreadyRegisteredWith(registry)) {
return;
}
}

private static boolean alreadyRegisteredWith(PluginRegistry registry) {
final String key = GeneratedPluginRegistrant.class.getCanonicalName();
if (registry.hasPlugin(key)) {
return true;
}
registry.registrarFor(key);
return false;
private static final String TAG = "GeneratedPluginRegistrant";
public static void registerWith(@NonNull FlutterEngine flutterEngine) {
}
}
24 changes: 22 additions & 2 deletions example/.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,27 @@
# This file should be version controlled and should not be manually edited.

version:
revision: 5391447fae6209bb21a89e6a5a6583cac1af9b4b
channel: stable
revision: "761747bfc538b5af34aa0d3fac380f1bc331ec49"
channel: "stable"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
- platform: web
create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49

# User provided section

# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
28 changes: 28 additions & 0 deletions example/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml

linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at https://dart.dev/lints.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
2 changes: 1 addition & 1 deletion example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "net.demo.languagepickersdemo"
minSdkVersion 16
minSdkVersion flutter.minSdkVersion
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand Down
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
25 changes: 15 additions & 10 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
// ignore_for_file: avoid_print, library_private_types_in_public_api

import 'package:flutter/material.dart';

import 'package:flutter/cupertino.dart';

import 'package:language_picker/languages.dart';
import 'package:language_picker/language_picker.dart';

void main() => runApp(MyApp());
void main() => runApp(const MyApp(key: Key('app')));

class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'language_picker Example',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(title: 'language_picker Example'),
home: const MyHomePage(title: 'language_picker Example'),
);
}
}

class MyHomePage extends StatefulWidget {
MyHomePage({Key? key, required this.title}) : super(key: key);
const MyHomePage({Key? key, required this.title}) : super(key: key);

final String title;

Expand All @@ -38,7 +42,7 @@ class _MyHomePageState extends State<MyHomePage> {
Widget _buildDropdownItem(Language language) {
return Row(
children: <Widget>[
SizedBox(
const SizedBox(
width: 8.0,
),
Text("${language.name} (${language.isoCode})"),
Expand All @@ -50,7 +54,7 @@ class _MyHomePageState extends State<MyHomePage> {
Widget _buildDialogItem(Language language) => Row(
children: <Widget>[
Text(language.name),
SizedBox(width: 8.0),
const SizedBox(width: 8.0),
Flexible(child: Text("(${language.isoCode})"))
],
);
Expand All @@ -60,11 +64,12 @@ class _MyHomePageState extends State<MyHomePage> {
builder: (context) => Theme(
data: Theme.of(context).copyWith(primaryColor: Colors.pink),
child: LanguagePickerDialog(
titlePadding: EdgeInsets.all(8.0),
titlePadding: const EdgeInsets.all(8.0),
searchCursorColor: Colors.pinkAccent,
searchInputDecoration: InputDecoration(hintText: 'Search...'),
searchInputDecoration:
const InputDecoration(hintText: 'Search...'),
isSearchable: true,
title: Text('Select your language'),
title: const Text('Select your language'),
onValuePicked: (Language language) => setState(() {
_selectedDialogLanguage = language;
print(_selectedDialogLanguage.name);
Expand All @@ -90,7 +95,7 @@ class _MyHomePageState extends State<MyHomePage> {
Widget _buildCupertinoItem(Language language) => Row(
children: <Widget>[
Text("+${language.name}"),
SizedBox(width: 8.0),
const SizedBox(width: 8.0),
Flexible(child: Text(language.name))
],
);
Expand Down Expand Up @@ -121,8 +126,8 @@ class _MyHomePageState extends State<MyHomePage> {
Expanded(
child: Center(
child: MaterialButton(
child: Text("Push"),
onPressed: _openLanguagePickerDialog,
child: const Text("Push"),
),
),
),
Expand Down
5 changes: 3 additions & 2 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@ publish_to: none
version: 1.0.0+1

environment:
sdk: ">=2.12.0 <3.0.0"
sdk: ">=2.12.0 <4.0.0"

dependencies:
flutter:
sdk: flutter

cupertino_icons: ^1.0.5
cupertino_icons: ^1.0.8

language_picker:
path: ../

dev_dependencies:
flutter_lints: ^4.0.0
flutter_test:
sdk: flutter

Expand Down
29 changes: 29 additions & 0 deletions example/test/widget_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility in the flutter_test package. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:language_picker_example/main.dart';

void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(const MyApp());

// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);

// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();

// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}
Binary file added example/web/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example/web/icons/Icon-192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example/web/icons/Icon-512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example/web/icons/Icon-maskable-192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example/web/icons/Icon-maskable-512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions example/web/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!DOCTYPE html>
<html>
<head>
<!--
If you are serving your web app in a path other than the root, change the
href value below to reflect the base path you are serving from.
The path provided below has to start and end with a slash "/" in order for
it to work correctly.
For more details:
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
This is a placeholder for base href that will be replaced by the value of
the `--base-href` argument provided to `flutter build`.
-->
<base href="$FLUTTER_BASE_HREF">

<meta charset="UTF-8">
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
<meta name="description" content="A new Flutter project.">

<!-- iOS meta tags & icons -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="example">
<link rel="apple-touch-icon" href="icons/Icon-192.png">

<!-- Favicon -->
<link rel="icon" type="image/png" href="favicon.png"/>

<title>example</title>
<link rel="manifest" href="manifest.json">
</head>
<body>
<script src="flutter_bootstrap.js" async></script>
</body>
</html>
35 changes: 35 additions & 0 deletions example/web/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "example",
"short_name": "example",
"start_url": ".",
"display": "standalone",
"background_color": "#0175C2",
"theme_color": "#0175C2",
"description": "A new Flutter project.",
"orientation": "portrait-primary",
"prefer_related_applications": false,
"icons": [
{
"src": "icons/Icon-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "icons/Icon-512.png",
"sizes": "512x512",
"type": "image/png"
},
{
"src": "icons/Icon-maskable-192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "icons/Icon-maskable-512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
}
]
}
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: language_picker
description: Language picker dropdown and dialog.
version: 0.4.3
version: 0.4.4+1
homepage: https://www.wafrat.com/
repository: https://github.com/atn832/language_picker

environment:
sdk: ">=2.12.0 <3.0.0"
sdk: ">=2.12.0 <4.0.0"

dependencies:
flutter:
Expand Down
Loading

0 comments on commit 59e0737

Please sign in to comment.